in reply to Re^2: Loop Control
in thread Loop Control
Off the top of my head, I can't think of an instance where $a = $b would give a different result than $a = "$b".This will explode horribly if $b is a reference. Compare the following:
The first one prints the array referenced by the reference. The second one simply prints a string containing the memory address of the array reference.[ateague@dingbat mod]$ perl -MData::Dumper -E '$b = [qw/1 2 3 4 5/]; $ +a = $b; say Dumper $a;' $VAR1 = [ '1', '2', '3', '4', '5' ]; [ateague@dingbat mod]$ perl -MData::Dumper -E '$b = [qw/1 2 3 4 5/]; $ +a = qq|$b|; say Dumper $a;' $VAR1 = 'ARRAY(0x12609e4)';
|
---|