#!/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.