Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: how to invoke unix commands in perl

by mirod (Canon)
on Feb 08, 2001 at 20:08 UTC ( #57196=note: print w/replies, xml ) Need Help??


in reply to how to invoke unix commands in perl

Read the doc! Perl comes with lots of docs. man perl on a unix box or use the Perl documentation that comes with the Activestate on Windows.

perldoc system would work fine (make sure you read how to avoid shell interpolation if you run in an insecure context like CGI)

Lastly my $var= `wc -l file`; will put the result of the command in $var.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://57196]
help
Chatterbox?
[james28909]: i see the predicament here.
[james28909]: maybe rename it to 'query'
[james28909]: but then you have the others as well
[Lady_Aleena]: Renaming things like get_THAC0 to just THAC0 was easy. These are harder.
[james28909]: consolidate the three subs into one

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (5)
As of 2017-05-24 04:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?