Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re^2: Limited Number of User Input

by rjt (Deacon)
on Mar 22, 2013 at 00:22 UTC ( #1024845=note: print w/replies, xml ) Need Help??


in reply to Re: Limited Number of User Input
in thread Limited Number of User Input

Yes, good. May I ask, why do you ask the user to enter the number of files first when you already know the simple, intuitive (and very commonly used) way like this for the user to indicate they're finished? If you need to know how many files they entered, you can do something like this:

while (<STDIN>) { chomp; last if $_ eq ''; push @files, $_; } printf "You entered %d files: { %s }\n", scalar @files, join(' ', @fil +es);

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1024845]
help
Chatterbox?
[Discipulus]: many monks want to be hired tonight, other haired and some aired
[Lady_Aleena]: Discipulus, do glob recurse?
[Lady_Aleena]: s/do/does/;
LanX wants to be fired
[Discipulus]: i fear no
[Discipulus]: i invented also 'gired'
[Lady_Aleena]: Discipulus, then that is a problem. I wanted to find total seconds of my entire .mp3 collection to do some math on it to see how many days of continuous music i have.
[LanX]: darn. .. I wanted to see Marine and Melonchon go to next round, just for fun xD

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (10)
As of 2017-04-23 20:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (432 votes). Check out past polls.