2

My question is I have folder containing 3 scripts(perlx2 and shellx1) and an internal folder of data that I wish to use in the perl scripts.

The shell script calls the two perl scripts consecutively the first one creating a file and the second one performing an analysis of the data from the created file.

From reading I could use Active perl or something of the sort to package the Perls scripts to be executable for a basic windows user. However I think it would make more sense if I made a sort of Batch file that will run the whole set of programs.

Sorry about my lack of knowledge I would love some help with this.

Thanks!

2 Answers 2

1

Running perl scripts from a .bat in Windows

Installation & Configuration of perl

First, install perl (I prefer Strawberry Perl but ActivePerl will work too).

This should put perl in your path, to check open up a command line and type:

echo %PATH%

You should see C:\strawberry\perl\bin in there (perl is in that directory).

Adding perl to your path (skip if already present)

Navigate Start -> Settings -> Control Panel -> System -> Advanced -> Environment Variables. Choose Path and append the following to the variable:

;C:\strawberry\c\bin;C:\strawberry\perl\bin

Close your command shell and open a new one. Retry echo %PATH%.

Assuming perl is in your path now...

Make a file called perlscripts.bat and type the following:

perl c:\path\to\scripts\script1.pl
perl c:\path\to\scripts\script2.pl

Running this batch should run the scripts in order as desired.

Sign up to request clarification or add additional context in comments.

Comments

0

The shell script calls the two perl scripts consecutively the first one creating a file and the second one performing an analysis of the data from the created file.

You can directly call those perl scripts from perl itself, it will work in both windows& linux, why shell/batch, why need bother every time for different OS. like, <script to run>

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.