Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Answer: How to run a shell script from a Perl program?

by snapdragon (Monk)
on May 14, 2001 at 14:11 UTC ( #80173=categorized answer: print w/replies, xml ) Need Help??

Q&A > programs and processes > How to run a shell script from a Perl program? - Answer contributed by snapdragon

The way to do this is to use a systen call to run your script:


However I thought that I'd mention a couple of points to go with this.

  1. Don't assume that your shell environment variables will be kept - a shell script that works fine on the command line may not work when run from Perl
  2. Be careful with your directories - try to make sure you're executing from the right place. It's often worthwhile to do a chdir to the right directory in Perl before calling your script. i.e.  chdir "/path/to/script/";

Good luck!

Log In?

What's my password?
Create A New User
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (6)
As of 2016-10-21 23:18 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (291 votes). Check out past polls.