[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Omaha.pm] next can jump out of a sub?



Wow. What do you suppose this prints?

I thought it would (1) syntax error (next without loop) or (2) print 1 and then exit. 

I was wrong...

j


for (1..5) {
   print "$_\n";
   x();
   exit;
}

sub x {
   next;
}