Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Declaring a code ref with arguments

by BrowserUk (Patriarch)
on Aug 05, 2003 at 09:13 UTC ( [id://280929]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub test{ print @_; }
    
    ...
    $coderef->( 'a different argument' ); 
    # Would print 'this is the argument'!!
    
  2. or download this
    sub test{ print 'this is the argument'; }
    
    ...
    $coderef->( 'a different argument' ); 
    # Prints 'this is the argument'!!
    
  3. or download this
    my $coderef = sub{ print @_; };
    $coderef->( 'Some', 'args' );
    # Prints 'someargs'
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-24 13:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found