Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Calling subs with &

by monktim (Friar)
on Oct 28, 2003 at 20:49 UTC ( #302812=note: print w/replies, xml ) Need Help??


in reply to Calling subs with &

You can also use & for evil purposes like using reserved words as sub names. It's not bad for obfuscation though.
use strict; &use(); #use(); #this doesn't work sub use { print "In sub\n"; }

Replies are listed 'Best First'.
Re: Calling subs with &
by Abigail-II (Bishop) on Oct 28, 2003 at 22:23 UTC
    It's not bad for obfuscation though.
    package Just_another_Perl_Hacker; sub print {($_=$_[0])=~ s/_/ /g; print } sub __PACKAGE__ { & print ( __PACKAGE__)} & __PACKAGE__ ( )

    Abigail

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (6)
As of 2022-08-10 17:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?