Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Declaring a code ref with arguments

by Juerd (Abbot)
on Aug 05, 2003 at 10:13 UTC ( [id://280939]=note: print w/replies, xml ) Need Help??


in reply to Declaring a code ref with arguments

In Perl 6, you will be able to use assuming:

sub print_me ($arg = "Hello World!\n") { print $arg; } %hash = ( no_arg => &print_me, with_arg => &print_me.assuming(arg => "Hello World, again!\n") ); %hash{no_arg}();

Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://280939]
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: (4)
As of 2024-04-19 13:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found