Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

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

by Plankton (Vicar)
on Apr 03, 2009 at 16:06 UTC ( #755305=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 Plankton

I like to do this sometimes ...
my $shell_out = <<`SHELL`; for fs in `/sbin/fdisk -l | grep -v swap | grep Linux | cut -d ' ' -f1 +` do /sbin/e2label \$fs | grep recovery > /dev/null 2>&1 && echo "Y +ES" && exit 0 done echo "NO" exit 0 SHELL
... to capture the stdout of the shell commands in a scalar var.

Log In?
Username:
Password:

What's my password?
Create A New User
Chatterbox?
[Corion]: Discipulus: Yes, but it seems to have handling in place to tell a cookie jar to extract cookies from responses and add them to other requests, which is what's needed
Discipulus must give a try to this module anyway..
[Discipulus]: so, combined with HTTP::CookieJar ?

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (8)
As of 2017-05-23 18:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?