Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

(crazyinsomniac: bah) Re^2: Question Marks in Subroutine Names

by crazyinsomniac (Prior)
on May 08, 2002 at 10:40 UTC ( [id://164975]=note: print w/replies, xml ) Need Help??


in reply to Re: Question Marks in Subroutine Names
in thread Question Marks in Subroutine Names

${'polly wanna cracker?'} = sub {'no'}; warn &${'polly wanna cracker?'}; warn ${'polly wanna cracker?'}->(); my %F = ( 'polly wanna cracker?' => sub {'no'}, ,); warn &{$F{'polly wanna cracker?'}}; die $F{'polly wanna cracker?'}->();
I wonder what people will wish for next, // in function names?

(I don't think either one will/should happen)

 
______crazyinsomniac_____________________________
Of all the things I've lost, I miss my mind the most.
perl -e "$q=$_;map({chr unpack qq;H*;,$_}split(q;;,q*H*));print;$q/$q;"

Replies are listed 'Best First'.
Re: (crazyinsomniac: bah) Re^2: Question Marks in Subroutine Names
by rob_au (Abbot) on May 08, 2002 at 13:11 UTC
    ++crazyinsomniac ... I would probably go just one step further and use type-globbing to simplify the subsequent function call - For example ...

    *{'is_contact_female?'} = sub { my @args = @_; ... }; &{'is_contact_female?'}( @args );

    I first encountered this manner of subroutine assignment in Damian Conway's selfGOL obfuscation, a "must-read" for any aspiring obfuscator.

     

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (6)
As of 2024-04-23 09:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found