in reply to Re: unless vs. bare block
in thread unless vs. bare block
unnecessarily verbose. In the first example, you could achieve the same end with:
That's a syntax error:
$x=1; unless( $x ) or warn 'Erk!';; [syntax error at (eval 11) line 1, near ") or"
Remember that unless is a 'negative' if, and Perl doesn't support if without a block.
Ie. In perl, if( cond ) statement must be coded as if( cond ) { statement; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: unless vs. bare block
by Anonymous Monk on May 10, 2012 at 04:12 UTC | |
by BrowserUk (Patriarch) on May 10, 2012 at 05:44 UTC |