Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^4: Executing a string as a Perl command

by dbs (Sexton)
on May 11, 2011 at 18:56 UTC ( [id://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

Replies are listed 'Best First'.
Re^5: Executing a string as a Perl command
by ctilmes (Vicar) 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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://904222]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (4)
As of 2024-04-25 17:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found