How to dereference a reference

Q

How to dereference a reference?

✍: Guest

A

There are a number of ways to dereference a reference:

  • Using two dollar signs to dereference a scalar like: $original = $$strref;
  • Using @ sign to dereference an array like: @list = @$arrayref;
  • Similar for hashes.

2007-11-21, 5232👍, 0💬