#!/usr/bin/perl -l $a = sub {return @_[0]}; $b = sub {return @_[0]+1}; if (0) { $i = $a; } else { $i = $b; } $number = 10; print &lala ($i); sub lala{ my $i = $_[0]; $res = &{$i}($number) ; #have also tried $res = $i->($number) with the same result } __END__ 11