Re: Perl Program Exits.
by BrowserUk (Patriarch) on Aug 03, 2012 at 06:48 UTC
|
END{ sleep 1e9; }
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
| [reply] [d/l] |
|
Thank you, this worked, I couldn't find how to edit it in properties though.
| [reply] |
|
I couldn't find how to edit it in properties though.
I'm not aware of any mechanism using the properties to prevent the window closing when the program finishes.
My 'fix' simply delays the program finishing for a very long time or until you manually close the window.
There is wperl.exe which can do something similar I think, but I've never used and can't find any documentation on how to use it.
With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
| [reply] |
|
|
You "could" setup this association
assoc .plA=PerlScriptAnnoying
FTYPE PerlScriptAnnoying=cmd.exe /k "perl.exe" %1 %*
set pathext=%pathext%;.PLA
and that would keep cmd.exe open after perl is finished (/k means keep cmd open) | [reply] [d/l] |
|
| [reply] |
Re: Perl Program Exits.
by tobyink (Canon) on Aug 03, 2012 at 06:34 UTC
|
Are you running this on Windows, by double clicking a file icon? If I recall correctly Windows automatically closes the command-line window once the program has finished running when a program has been started this way, but there is a way to change that behaviour somewhere by right clicking the file and going into its properties.
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
| [reply] |
Re: Perl Program Exits.
by 2teez (Vicar) on Aug 03, 2012 at 08:00 UTC
|
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
| [reply] [d/l] |
Re: Perl Program Exits.
by nemesdani (Friar) on Aug 03, 2012 at 07:50 UTC
|
| [reply] [d/l] |
|
D:\tools\perl\bin\perl -Id:/tools/perl/lib -w objcmp.pl D:\releases\12
+113129 YES > xxx.txt
pause
| [reply] [d/l] [select] |