answersLogoWhite

0

Why do my Perl programs close instantly after execution?

Updated: 8/17/2019
User Avatar

Wiki User

14y ago

Best Answer

When running programs that target the Console environment, once the last line of code has been executed, the application ends and returns back to the console. If you want your Perl applet to "pause" after running before returning to the console, add these lines to the end:
print STDOUT "Press [Enter] to quit.";
getc STDIN;
(And I have to caveat this by saying "I have not done Perl programming for many years, so there may be errors in the above.")

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Why do my Perl programs close instantly after execution?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is perl good for?

The Perl Programming system is used to script language for computer tasks or programs. It can write scripts for science, finance, graphics and system administration programs.


What is the computer program Perl and how do you use it?

Perl is a programming language, and to use it requires many hours of reading about it and of practice writing programs in it.


Which is the most popular programming language used for CGI programs?

Perl is the most popular language used for CGI programs.


Why the programs of C and java are compiled before execution?

Because the source programs just do not run. Full stop.You have to1) compile them to an executable (C)2) use a program that interprets them (script languages, eg. sh, perl, php)3) mix the two: half-compile them into something that can be interpreted by another program (source -> javac.exe -> bytecode -> java.exe)


Is PERL an interpreted or compiled programming language?

Perl is both compiled and interpreted language. In the traditional sense, Perl is a pure interpreted language. The reference Perl program is a prototypical two-stage interpreter: when a Perl script is invoked via #!/bin/perl (or similar), the perl interpreter performs a language parsing on the source code, creating an internal (to the perl interpreter) representation of program, which is then translated into binary code for execution. Every invocation of a perl program requires this translation/interpretation to be completed. There are several projects which can take perl source code and compile it down to a binary executable (that is, bypass the whole repeated translate/interpret phase each time). However, these are NOT complete - even the best can only manage about 95% of the perl code available. That is, these perl compiler are incomplete implementations of the Perl language. They can be very useful, but are not complete substitutes for the Perl interpreter. The real answer is that Perl was designed to be an interpreted language from the start; attempts to turn Perl into a compiled language are faced with the difficulty of Perl's sprawling syntax and complete lack of design for compilation, and thus, struggle to implement all the languages features in a compiler.


How do you run perl programs in editplus?

You should have perl installed in your machine.1.Open EditPlus2.Go to Tool->Configure User Tools..3.Click Add Tools>>Select Program4.Give Below OptionMenu Text:PerlCommand:C:\Perl\bin\perl.exe(Browse to location)Argument:$(FileName)Initial Directory:$(FileDir)5.Click Capture OutputWrite a new perl program and go to Tools->Perl to run the program


What has the author Masateru Miyasaka written?

Masateru Miyasaka has written: 'CGI/Perl handbook' -- subject(s): CGI (Computer network protocol), Internet programming, Perl (Computer program language), Web servers, Computer programs


All programs written for today's PCs are compiled as?

No, some of them are not compiled, but interpreted (languages perl, python, php, ruby etc,).


What are some facts about Perl?

Perl is a programming language. Perl is an interpreted programming language. Perl is very useful for shell scripts, application programming, and web applications. Perl is quite easy to learn. Perl can be, but does not have to be, object-oriented. Perl was created by Larry Wall. Perl has probably the best implementation of regular expressions in existence.


Where can one find information about Learning Perl?

There are a number of sites that provide information about how to learn the Perl programming language. They include Learn Perl, Learning Perl and Perl Tutorial Hub. Amazon and other good booksellers have a wide range of Perl books available.


What are some commonly used Programming Software programs?

A few of the many commonly used programming software programs are: Alice, which is used for programming 3D environments; Eclipse, used for Java; and Perl, for use with CPAN.


What is the definition of a pal?

become friends; act friendly towardsbuddy: a close friend who accompanies his buddies in their activities wordnetweb.princeton.edu/perl/webwn