>>>>> On Thu, 13 Apr 2000 15:43:34 +0200, operator@periszrz.zrz.tu-berlin.de (ZRZ-Operator) said: > This is a bug report for perl from siegel@zrz.tu-berlin.de, > generated with the help of perlbug 1.28 running under perl v5.6.0. > ----------------------------------------------------------------- > [Please enter your report here] > Please watch this: > perl -e 'sub foo (;&) {} foo {};' > Type of arg 1 to main::foo must be block (not single ref constructor) at -e line 1, near "};" > Calling foo with a bare block should be possible, at least perlsub doesn't > say otherwise. The error goes away when you make the coderef parameter > required, changing "(;&)" to "(&)". You are required to say perl -e 'sub foo (;&) {} foo sub {};' ^^^ > The bug, if it is a bug, was present in Perl 5.5 as well, though the > message said "(not scalar ref constructor)" instead of "...single...". I think the bug is currently a (unsufficiently?) documented misfeature. Here the easy to miss sentence from man perlsub: An & requires an anonymous subroutine, which, if passed as the first argument, does not require the "sub" keyword or a subsequent comma. That seems to need a rewording, maybe .... if passed as the first mandatory argument .... Cheers, -- andreasThread Previous