Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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 exploiting the Monastery: (10)
As of 2015-07-06 12:05 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 (73 votes), past polls