in reply to Re: Need to check my understanding of this code...
in thread Need to check my understanding of this code...

Not quite. Shift removes the first entry from the list, a simple assignment doesn't (although since that list is never used again, in this context it makes no difference - except that the assignment is slightly faster). Compare:

#!/usr/bin/perl use strict; use warnings; my @list = qw/a b c/; my ($x) = @list; print "X: $x, List: @list\n"; my $y = shift @list; print "Y: $y, List: @list\n";

The output being:

X: a, List: a b c
Y: a, List: b c

Replies are listed 'Best First'.
Re^3: Need to check my understanding of this code...
by borisz (Canon) on Sep 04, 2005 at 19:36 UTC
    ???, I think one of us misread the question. I talk about the difference from my $x = shift; and my ($x) = shift @_; sure, there is a difference, but not in the context of the question.
    Boris

      Whoops. I've never seen anybody shift into an list context before. I must have had a bit of a blind spot there.