13

I have perl express 2.5 loaded on my server. I would like to be able to run my perl scripts using a command line so they can be scheduled rather than manually bringing up the script in Perl Express and clicking on the run command. Is there a way to execute the script from a command line using this version of Perl or do I need to download a newer or more robust version of the Perl Engine.

1
  • 2
    @dougEfresh — Perl Express is Windows only.
    – Quentin
    Jul 19, 2013 at 14:35

3 Answers 3

15

You need to export the Perl interpreter (usually named perl) to your path. Then you can simply do

perl path/to/script.pl

In UNIX-based systems you are also able to run the scripts directly if you prepend

#!/usr/bin/perl

to the scripts and give them executable permissions (you might need to replace /usr/bin/perl with the path to your Perl interpreter).

6

According to the documentation:

Perl Express is not tied to a specific Perl port and should work with any build for Windows.

and the system requirements:

Windows 98/Me/2000/XP/2003, Perl Interpreter

So you, presumably, have a separate Perl distribution already installed somewhere. That should have a perl.exe executable that you can use to run your script.

3

You just need to give perl command and the path of your perl script. example :

D:\Project\dir>perl <path_of_perl_script .pl>
2
  • sorry, D:\Project\dir>perl <path to perl script .pl>
    – pal
    Jun 9, 2017 at 4:52
  • 4
    Instead of commenting your edits, edit your answer by clicking on edit button
    – S.R
    Jun 9, 2017 at 4:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.