Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: AUTOLOAD, overload, and Roman numerals for Perl

by ikegami (Pope)
on Jun 29, 2007 at 15:59 UTC ( #624112=note: print w/replies, xml ) Need Help??


in reply to AUTOLOAD, overload, and Roman numerals for Perl

Barewords are autoquoted (BAREWORD -> 'BAREWORD'), except in two situations.
1) If a function was already declared with that name, it will be treated as a function name.
2) If a glob is expected (such as print's first argument), then it will be treated as a glob (BAREWORD -> *BAREWORD).

A bareword is only treated as a function name when a function with that name has already been declared, so AUTOLOAD won't work. Autoquoting of barewords can't be overriden by overload, so overload won't help. Looks to me like you're stuck using &I/I() or a source filter.

Note: use strict will generate an error when bareword autoquoting occurs outside of a hash index.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://624112]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2020-12-04 02:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How often do you use taint mode?





    Results (58 votes). Check out past polls.

    Notices?