in reply to a reference by any other name...
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: a reference by any other name...
by blogical (Pilgrim) on Feb 20, 2006 at 01:55 UTC | |
by GrandFather (Saint) on Feb 20, 2006 at 02:03 UTC | |
by blogical (Pilgrim) on Feb 20, 2006 at 02:42 UTC | |
by GrandFather (Saint) on Feb 20, 2006 at 02:56 UTC |