use strict; my $flag = shift; my $hello = (sub { return "hello by reference\n";}); print $xello->() if $flag;