develooper Front page | perl.perl5.porters | Postings from June 2012

Re: [perl #113554] my() with empty list causes weird error

Thread Previous | Thread Next
Reini Urban
June 25, 2012 17:05
Re: [perl #113554] my() with empty list causes weird error
Message ID:
Sorry Tom to drag you into this, but apparently 5.18 will need an
update for your book.

The error message for my(); is codified in "Programming Perl".

  Can't declare %s in my

  (F) Only scalar, array and hash variables may be declared as lexical
variables. They must have ordinary identifiers as names, since lexical
variables don't live in a symbol table, and can't be package

Do see an empty list there? Do you see "ordinary identifiers"?
Do you see that the error is F(atal)?
Allowing empty lists for my would need another update for this book,
which is fat enough.

Programming Perl misses our and state here, but I got only
"The version By Larry Wall, Tom Christiansen & Randal L. Schwartz;
ISBN 1-56592-149-6, 670 pages.
Second Edition, September 1996"

They allowed now "my();" because MAD patched that away and they want to be
consistent with MAD, instead of fixing MAD and improving the word "stub" in the
error message to "()".

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About