in reply to Re^5: Loading all files in a dir with use via for loop
in thread Loading all files in a dir with use via for loop
That does work because of the super-low-precedence of 'or'.Actually, it doesn't work. The if wants to evaluate all of the following expression. It's not very readable, thougheither.: someone who doesn't understand the lower-precedence-ness of 'or' (compared to '||', especially). To them it would look like you shouldIt will try to eval $PAGE if one of the two or statements is true. Also, you don't need to specify main-> for nopageerror.
For clarity, I suggest one of these:
# whoops, syntax errors, thanks to Roy Johnson ## ( eval "$PAGE" if main->can($PAGE) ) or nopageerror; ## or... #( eval "$PAGE" if main->can($PAGE) ) # or nopageerror; ## or... if ( main->can($PAGE) ) { eval $PAGE } else { nopageerror }
Updates:
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^7: Loading all files in a dir with use via for loop
by Roy Johnson (Monsignor) on Sep 29, 2005 at 20:33 UTC | |
|
Re^7: Loading all files in a dir with use via for loop
by Delusional (Beadle) on Sep 30, 2005 at 13:02 UTC |