M
Mark
Why does the introduction of the assignment to @b affect the value of
$cnt?
use strict;
use warnings;
my $cnt;
my($x,$y,$z);
my(@ary) = qw(a b c d e);
$cnt = ( ($x,$y,$z) = @ary );
print "cnt=$cnt\n"; # produces 5
my @b;
$cnt = ( @b = ($x,$y,$z) = @ary );
print "cnt=$cnt\n"; # produces 3
$cnt?
use strict;
use warnings;
my $cnt;
my($x,$y,$z);
my(@ary) = qw(a b c d e);
$cnt = ( ($x,$y,$z) = @ary );
print "cnt=$cnt\n"; # produces 5
my @b;
$cnt = ( @b = ($x,$y,$z) = @ary );
print "cnt=$cnt\n"; # produces 3