Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: coderef to an object method

by revdiablo (Prior)
on Jul 21, 2004 at 05:29 UTC ( [id://376165]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
      {
        package foo;
    ...
      $cr = \&foo::foo;
    
      print $cr->($foo), "\n" for 1 .. 5;
    
  2. or download this
      {
        package foo;
    ...
      $cr = sub { $foo->foo(@_) };
    
      print $cr->(), "\n" for 1 .. 5;
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (7)
As of 2024-04-19 15:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found