Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I run a Perl script with ActivePerl?

Tags:

perl

I just recently installed ActivePerl 5.12.2.1202 on my Windows XP in C:/Perl. I am new to Perl scripting.

I just want to run a Perl program which contains one print statement, which I saved in Notepad with the name ex.pl.

  1. How can I run this Perl program?
  2. Can I use an editor for typing a Perl script other than Notepad?
  3. How do I use ActivePerl?
like image 953
John Avatar asked Sep 09 '10 06:09

John


People also ask

How do I run Perl script in ActivePerl?

Running Perl scripts from the command line¶ Where yourscriptname.pl is the name of the script you want to run. If you are using Windows and have associated the extension of the file with Perl, typing yourscriptname.pl (that is, without calling perl first) will also launch the script.


2 Answers

  • Run Perl program from command prompt

    start->run>cmd (command prompt will appear), write perl full_path_of_your_script, like
    C:\> perl hello.pl #This assumes that perl is in your PATH environment variable.

  • There are many Perl Editors, you can used for Perl scripts like DzSoft, Perl Expess, Komodo Edit etc and also see http://www.perlmonks.org/?node_id=169668 and Perlfaq3- Windows Perl Editors for more detail.

  • Have a look at http://docs.activestate.com/activeperl/5.12/, for ActivePerl 5.12 documentation.

like image 59
Nikhil Jain Avatar answered Oct 23 '22 09:10

Nikhil Jain


Perl programs (or any other program run by an interpreter) is run by passing the script as a command-line argument to the interpreter. For example, in this case:

perl.exe ex.pl

Padre the Perl IDE and Kephra are good editors for Perl.

As an alternative to ActivePerl, there is Strawberry Perl.

like image 34
Alan Haggai Alavi Avatar answered Oct 23 '22 09:10

Alan Haggai Alavi