#!/usr/bin/perl sub xxx { my $x1 = shift; my $x2 = shift; print "$x1, $x2\n"; } sub yyy { my $func = shift; $func->(@_) } yyy( \&xxx, "foo", 42 ); # \&xxx is the sub reference.
In reply to Re: Pass sub reference
by Anonymous Monk
in thread Pass sub reference
by vit
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |