Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: Adding Default Values [for BEGINNERS]

by ikegami (Pope)
on Dec 21, 2006 at 22:57 UTC ( #591218=note: print w/replies, xml ) Need Help??


in reply to Adding Default Values [for BEGINNERS]

What follows is a sample construct for asking again instead of using a default.

my $file; for (;;) { print "Which file do you want to open? "; $file = <STDIN>; chomp($file); last if length $file; print "Please supply a file name.\n"; }

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (4)
As of 2021-06-22 01:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)












    Results (100 votes). Check out past polls.

    Notices?