in reply to Re (3): loop control
in thread loop control

While the use of the angle brackets here is strange and unnecessary, I don't see how it breaks the original code. I tried it, and it works fine with Perl 5.6.1. I thought that maybe the while on <@list> would maybe only work once; i.e.; the first end-of-list would behave like and EOF and have to be reset somehow. But that's not the case in my tests.

my @x = (qw/a b c abc def ghi z/); while (<@x>) { print "<$_>\n"; } print "\n\n"; while (<@x>) { print "<$_>\n"; }

<a> <b> <c> <abc> <def> <ghi> <z> <a> <b> <c> <abc> <def> <ghi> <z>

Replies are listed 'Best First'.
Re (5): loop control
by VSarkiss (Monsignor) on Feb 04, 2003 at 17:34 UTC

    That worked because you had no files in the current directory named a, b, c, abc, ..., or any of the strings in @x. The angle brackets are globbing in this case, as John M. Dlugosz pointed out above. Check out perlio, then try adding * to @x and running your code again.