Roman Makurin wrote:

use constant {
        A => 1,
        B => 2,
        C => 3 };

@a = (1, 2, 3);
@b = (A, B, C);

# first loop
while(my $i = shift @a) {
        print $i, $/
}

# second loop
while(my $i = shift @b) {
        print $i, $/
}

My question is why the first loop work as expected, but
second doesnt.

My questions are: How did you expect the second loop to work, and what output did you get? (They both "worked" fine for me.)

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to