use strict; use warnings; use Test::Simple tests => 2; sub is { use Scalar::Util qw(refaddr); return (refaddr $_[0] == refaddr $_[1]); } my $x = 3; my $y = 3; my $x_ref = \$x; my $test_ref_1 = \$x; my $test_ref_2 = \$y; ok( is($test_ref_1, $x_ref), 'Same' ); ok( !is($test_ref_2, $x_ref), 'Different' );
In reply to Re: Python 'is' command
by BillKSmith
in thread Python 'is' command
by betmatt
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |