Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: how to invoke unix commands in perl

by arhuman (Vicar)
on Feb 08, 2001 at 20:04 UTC ( #57195=note: print w/ replies, xml ) Need Help??


in reply to how to invoke unix commands in perl


use backquote :
$result=`wc -l /etc/passwd`;
or use system or exec


Comment on Re: how to invoke unix commands in perl
Select or Download Code
Re: Answer: how to invoke unix commands in perl
by arhuman (Vicar) on Feb 08, 2001 at 20:10 UTC
    OOPS ! I can't modify it...

    Please use your usual doc (Site Library, Camel book, perldoc) to understand the implication in term of process forking, shell spawning, security...
    But most of all don't forget that spawning a shell is cpu/memory consumming and can often be avoided by few perl internal function...
    (Especially in this case of a wc -l)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://57195]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (16)
As of 2014-09-30 14:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (374 votes), past polls