sub block(&) { shift->(); } my $a = shift @ARGV || block { print "Enter value for a:"; }; print "$a\n";