Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Trying to Understand Callback(s)

by shmem (Chancellor)
on Nov 24, 2017 at 00:29 UTC ( [id://1204184] : note . print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    sub routine { 
       my($thingy, $tx) = @_; # $thingy is not used
    ...
    # we could also say...
    #   my $pkg = __PACKAGE__;
    # ...to get any package we are in in compile time
    
  2. or download this
    # method calls
    
    ...
    
    routine ($obj,   "foo");
    # etc.
    
  3. or download this
    my (undef, $thing) = @_;
    
  4. or download this
    shift @_; # drop first element of argument list
    my ($thing) = @_;