[EMAIL PROTECTED] wrote:
Are these two statements the same?

my (@array, @array1) = ( );

my @array = my @array1 = ( );

$ perl -le' my $x = q/my (@array, @array1) = ( );/; my $y = q/my @array = my @array1 = ( );/; print "These two are ", $x eq $y ? "" : "NOT ", "the same."; ' These two are NOT the same.


All kidding aside, the first statement assigns everything in the right hand list to the first array (or hash) on the left and every variable after that receives nothing, but since my() has the same affect as assigning an empty list to an array or a hash the result is the same.
The second statement assigns an empty list to an empty array and the result of that is assigned to another empty array.




John
--
use Perl;
program
fulfillment

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to