in reply to Re: For vs. Foreach
in thread For vs. Foreach
Using 'for' is a compile time error, using 'foreach' a run time error (resulting in abortion of the compilation).$ perl -wE 'sub foo: foreach' Invalid CODE attribute: foreach at -e line 1 BEGIN failed--compilation aborted at -e line 1. $ perl -wE 'sub foo: for' syntax error at -e line 1, next token ??? Execution of -e aborted due to compilation errors.
If someone could show how to use 'for' inside an attribute, that would be dandy.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: For vs. Foreach
by tilly (Archbishop) on Feb 13, 2009 at 19:49 UTC |