Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Use of system() considered harmful

by merlyn (Sage)
on Jun 06, 2008 at 20:52 UTC ( [id://690762]=note: print w/replies, xml ) Need Help??


in reply to Use of system() considered harmful

my $binary = "/bin/foo bar"; system($binary);
system will always try to execute /bin/foo with argument bar. But what if my executable is /bin/foo bar?
Then you use:
system { $binary } $binary, @other_args_if_any;
That forces "list" interpretation rather than single-element list, and all is good.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (4)
As of 2024-04-25 13:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found