Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: trapping ctrl-d

by count0 (Friar)
on Dec 31, 2001 at 21:46 UTC ( #135400=note: print w/replies, xml ) Need Help??


in reply to trapping ctrl-d

You don't really need to stop the user from sending an EOF, you just need to keep prompting for input until you get what you want:
until ($condition) { # Keep reading from STDIN. # Store and/or process the input. }

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://135400]
help
Chatterbox?
[Lady_Aleena]: Taking the printing functionality out of a module is hard at times. The one I'm currently working on has conditionals and loops for the data to be printed.
[Lady_Aleena]: Some are as easy as returning instead of printing, but only some.
[atcroft]: Lady_Aleena: So you are shoving the disparate data into a structure and returning the structure, so you can run it through a (probably simpler) routine that displays only?

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2017-05-29 02:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?