This may be what you want:
use strict; use warnings; my @array1; my @array2; my $ref1 = \@array1; my $ref2 = \@array1; my $ref3 = \@array2; print "Maybe what you want\n" if $ref1 == $ref2; print "Not what you want\n" if $ref1 == $ref3;
Prints:
Maybe what you want
Note that \@name1 returns a reference and I suspect what you want to know is if two references refer to the same object.
In reply to Re: a reference by any other name...
by GrandFather
in thread a reference by any other name...
by blogical
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |