in reply to optional command line arguments
How about using prototypes to emulate your own block?
sub block(&) { shift->(); } my $a = shift @ARGV || block { print "Enter value for a:"; <STDIN> }; print "$a\n";
|
---|
In Section
Seekers of Perl Wisdom
in reply to optional command line arguments
How about using prototypes to emulate your own block?
sub block(&) { shift->(); } my $a = shift @ARGV || block { print "Enter value for a:"; <STDIN> }; print "$a\n";
|
---|