in reply to Re: When CGI->new doesn't return a CGI object
in thread When CGI->new doesn't return a CGI object
Then $x and $y are different references that refer to the same array, which has been blessed into the Bar package.
This is a common misunderstanding (even by the serious pros. Data::Dumper has a flaw that IMO can be traced back to this subtle mistake) In reality you should have said
Then $x and $y are different scalar variables holding a reference to the same array, which has been blessed into the Bar package.
This is a crucial distinction. Consider how many distinct variables are present in the two following snippets:
andmy ($z,$x,$y); $x=\$y; $y=\$x; $z=[$x,$y];
Note that dumping $z in both cases will result in the same output when using Data::Dumper.my $z=[]; $z->[0]=\$z->[1]; $z->[1]=\$z->[0];
Pedantic can be fun and useful sometimes... :-)
Oh yes, the correct answer to my question can be found in the source of the node.
--- demerphq
my friends call me, usually because I'm late....
|
|---|