in reply to Passing an array to a subroutine
sub foo { my ($helper)= @_; $helper->(42, "Hello World"); } sub help1 { my ($value, $caption)= @_; print "$caption $value squared is",$value*$value,"\n"; } # main code foo (&help1); [download]