Help for this page

Select Code to Download


  1. or download this
    sub callback { sub { shift->( @_ ) } }
    
  2. or download this
    sub callback {
        my $coderef = shift;
    ...
    my $yours = short_but_wrong( \&foo, 1, 2, 3 );
    print "Mine:  "; $mine->();
    print "Yours: "; $yours->();
    
  3. or download this
    X: 1 2 3
    Undefined subroutine &main:: called at cback line 7.
    
  4. or download this
    sub callback {
        my ( $coderef, @args ) = @_;
        sub { $coderef->( @args ) }
    }