## MacPerl 5.6 (Panther+Classic) xxxx 0 - SCALAR(0x85f461c) - 1 xxxx 1 - SCALAR(0x85f4628) - 2 xxxx 2 - SCALAR(0x85f6da0) - 3 xxxx 3 - SCALAR(0x85f6dac) - 4 xxxx 4 - SCALAR(0x85f6db8) - 5 xxxx 5 - SCALAR(0x85f6dd0) - hello world xxxx 6 - SCALAR(0x85f6de8) - 21
## Perl 5.8.2 -- Panther xxxx 0 - SCALAR(0x806eac) - 1 xxxx 1 - SCALAR(0x806ea0) - 2 xxxx 2 - SCALAR(0x809224) - 3 xxxx 3 - SCALAR(0x809230) - 4 xxxx 4 - SCALAR(0x80923c) - 5 xxxx 5 - SCALAR(0x809254) - hello world xxxx 6 - SCALAR(0x80926c) - 21
______
At 11:52 pm -0800 1/12/03, Mark Alldritt wrote:
I'm struggling to try and understand a difference in the way my script runs in Perl 5.6/Jaguar and Perl 5.8.1/Panther. Consider this example:
sub x { for my $iii (0 .. (scalar @_) - 1) { my $iiiRef = \$_[$iii]; print STDOUT "xxxx $iii - $iiiRef - $$iiiRef\n"; } } x(1,2,3,4,5, 'hello world', 1 + 20);
Under Jaguar/Perl 5.6, I get output like this:
[inez:~/Desktop] mall% perl xxx.pl xxxx 0 - SCALAR(0xdb48) - 1 xxxx 1 - SCALAR(0xdb3c) - 2 xxxx 2 - SCALAR(0x12ab0) - 3 xxxx 3 - SCALAR(0x12abc) - 4 xxxx 4 - SCALAR(0x12ac8) - 5 xxxx 5 - SCALAR(0x12ae0) - hello world xxxx 6 - SCALAR(0x12af8) - 21
Notice how the addresses are all different, as they should be. When I run the same script on my Panther/Perl 5.8.1 machine I get this:
fatmat:~/Desktop mall$ perl xxx.pl xxxx 0 - SCALAR(0x801264) - 1 xxxx 1 - SCALAR(0x801264) - 2 xxxx 2 - SCALAR(0x801264) - 3 xxxx 3 - SCALAR(0x801264) - 4 xxxx 4 - SCALAR(0x801264) - 5 xxxx 5 - SCALAR(0x801264) - hello world xxxx 6 - SCALAR(0x801264) - 21
Notice how the addresses are all the same! How can they be the same? More importantly, how do I get Perl 5.8.1 to do the right thing?
