The [Python] 'is' command ... checks whether the same memory reference is used in each case. ... I am assuming that you can do exactly the same in Perl using a ref command in conjunction with '=='.
No ref command need apply.
This works due to numeric coercion of a reference.c:\@Work\Perl\monks>perl -wMstrict -le "my $ar_a = [ qw(a b c d) ]; my $ar_b = $ar_a; ;; print 0+$ar_a; print 0+$ar_b; ;; print 'is equal' if $ar_a == $ar_b; " 22632908 22632908 is equal
Give a man a fish: <%-{-{-{-<
In reply to Re: Python 'is' command
by AnomalousMonk
in thread Python 'is' command
by betmatt
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |