Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Perl Program Exits.

by 2teez (Priest)
on Aug 03, 2012 at 08:00 UTC ( #985177=note: print w/ replies, xml ) Need Help??


in reply to Perl Program Exits.

I know this is basic, but can anyone help me out?

Here is something you can do, using the 'diamond' operator <> .
Since, "<>" expect an input from the keyboard, your program doesn't exit until you press ENTER key on the keyboard. Therefore, just pressing the ENTER key exit your program.
Here is an exmple:

#!/usr/bin/perl use warnings; use strict; foreach(0..9){ print $_,$/; } <>; # press Enter to quit


Comment on Re: Perl Program Exits.
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2015-07-02 05:32 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 (29 votes), past polls