http://www.perlmonks.org?node_id=57195


in reply to how to invoke unix commands in perl


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

Replies are listed 'Best First'.
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)