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
|
|---|