Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Calling subs with &

by monktim (Friar)
on Oct 28, 2003 at 20:49 UTC ( [id://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?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (None)
    As of 2024-04-25 01:03 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found