Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: optional command line arguments

by influx (Beadle)
on Aug 07, 2012 at 20:39 UTC ( #986078=note: print w/ replies, xml ) Need Help??


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";


Comment on Re: optional command line arguments
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://986078]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (15)
As of 2015-07-06 13:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (75 votes), past polls