Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: backslashes in shell commands

by Khen1950fx (Canon)
on Mar 09, 2013 at 15:02 UTC ( #1022576=note: print w/ replies, xml ) Need Help??


in reply to backslashes in shell commands

A good substitute for backticks is the capturex function from IPC::System::Simple. It's like backticks in list context, and it will not invoke the shell. If you want the shell, then use the capture function. For example:

#!/usr/bin/perl -l use strict; use warnings; use IPC::System::Simple qw/capturex/; my @args = "%s I\x27ll"; my $cmd = capturex("printf", @args); print $cmd;
I really hope this helps you.


Comment on Re: backslashes in shell commands
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (4)
As of 2015-07-04 00:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (57 votes), past polls