Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^4: Executing a string as a Perl command

by dbs (Sexton)
on May 11, 2011 at 18:56 UTC ( #904222=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Executing a string as a Perl command
in thread Executing a string as a Perl command

I thought using eval in that way, on a scalar to execute a command is a NO-NO for security and not best practice!

cant you just use the qx or system call?


Comment on Re^4: Executing a string as a Perl command
Re^5: Executing a string as a Perl command
by ctilmes (Priest) on May 16, 2011 at 10:56 UTC
    I thought using eval in that way, on a scalar to execute a command is a NO-NO for security and not best practice! cant you just use the qx or system call?

    You must think about where the scalar came from, and how much you trust that source (taint checking can help you keep track of that, but you still have to think about it), but if you do trust it, it is fine.

    You similarly have to think about it if you interpolate it (uselessly) into a string.

    Even more so for qx or system.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://904222]
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: (5)
As of 2014-12-28 22:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (183 votes), past polls