LanX has asked for the wisdom of the Perl Monks concerning the following question:
This works
sub block(&) { return undef; } print block {'whatever'} || "is undef";
This doesn't
sub block(&) { return undef; } print block {'whatever'} // "is undef"; __END__ String found where operator expected at bug.pl line 6, near "// "is un +def"" (Missing operator before "is undef"?) Too many arguments for main::block at bug.pl line 6, near "// "is unde +f"" syntax error at bug.pl line 6, near "// "is undef"" Execution of bug.pl aborted due to compilation errors.
Tested with 5.14 and 5.22 ... Insights?
Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: BUG when parsing defined-or ?
by Anonymous Monk on Jan 25, 2016 at 02:32 UTC | |
by LanX (Saint) on Jan 25, 2016 at 03:09 UTC | |
|
Re: BUG when parsing defined-or ?
by BrowserUk (Patriarch) on Jan 24, 2016 at 22:32 UTC | |
by LanX (Saint) on Jan 24, 2016 at 22:41 UTC | |
|
Re: BUG when parsing defined-or ?
by Anonymous Monk on Jan 25, 2016 at 00:03 UTC | |
by LanX (Saint) on Jan 25, 2016 at 01:21 UTC |