Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
What you're missing is the fact that I want to bypass the shell. I don't want to subject to its quoting rules and I don't want it to see 'foo;rm -rf /'. I don't want to second-guess the shell by escaping metacharacters and hope I get them all... I just don't want to have to worry at all.

And from my dim, dark memories of shell programming, to quote a single quote, e.g. don't, you have to say 'don'"'"'t', which means that your code would produce incorrect results. This stuff is tricky!

Backticking is a concise construct for extracting output from external programs, but as things stand, you cannot avoid bringing the shell into the picture. If you could be certain that you were calling the child program directly, a lot of the security hassle would magically evaporate.

It's another "Doctor, Doctor" story.

Patient: Doctor, doctor, when I stick my arm out the car window, it gets smashed to pieces by a passing truck.
Doctor: Well, don't do that then.

If I knew I didn't have to stick my arm out, I'd be fine. But the only way to do that in the current scenario is to go through all the hoops of forking and listening to my child. In my books this is One More Damned Thing To Go Wrong. Programming Perl, the book, hinted that in the future such a thing was going to be possible, but on the face of things it looks like it was an idea never went anywhere.


print@_{sort keys %_},$/if%_=split//,'= & *a?b:e\f/h^h!j+n,o@o;r$s-t%t#u'

In reply to Re:x2 Backticked commands and the readpipe blues by grinder
in thread Backticked commands and the readpipe blues by grinder

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (5)
As of 2024-04-25 11:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found