Gossamer Forum
Home : General : Perl Programming :

is there a command so the Perl program will "pause"?

Quote Reply
is there a command so the Perl program will "pause"?
i wrote a script that outputs a name after you input it...saved it as a ".pl" file (it becomes a yellow ball icon on the desktop)...when i run it, it runs and when the last "print" command is run, it almost instantenously closes, not leaving enough time to read the last line...how can i make the script stay visible for a certain length of time??


if you know anything about the TI-83+, the type of command i am looking for would be the "Pause"...
Quote Reply
Re: [skateboarder83] is there a command so the Perl program will "pause"? In reply to
Try sleep. http://www.perldoc.com is your source to find out details on this function...

Example;

sleep(10);

Andy (mod)
andy@ultranerds.co.uk


IMPORTANT: I've now moved to ultranerds.co.uk, and the .com will no longer work!
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [skateboarder83] is there a command so the Perl program will "pause"? In reply to
You are just popping up a command prompt. Either use your browser or open up a command prompt and run your script from there instead of just clicking the perl script.
Quote Reply
Re: [Andy] is there a command so the Perl program will "pause"? In reply to
yep, sleep command works....thanks!
Quote Reply
Re: [skateboarder83] is there a command so the Perl program will "pause"? In reply to
Mm you don't need sleep if you do what I suggested :)

You should open a command prompt and then run your code from there and then it won't close at the end of execution.
Quote Reply
Re: [Paul] is there a command so the Perl program will "pause"? In reply to
yeah i know, but when im showing someone whast i've written, it looks a lil better without all the other stuff...thanks though, for just checking your way is good!
Quote Reply
Re: [skateboarder83] is there a command so the Perl program will "pause"? In reply to
Code:
print "Press 'Enter' to continue...";
<STDIN>
The program will wait until the 'enter' key is pressed before continuing, allowing you to pause the program as long as you wish.