Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: A daemon to tail a log and fork multiple external (perl) script

by afoken (Chancellor)
on Nov 19, 2015 at 18:50 UTC ( [id://1148144]=note: print w/replies, xml ) Need Help??


in reply to A daemon to tail a log and fork multiple external (perl) script

 exec("/bin/prgPROCESS ".$line) ;

Just two little notes:

  • exec may fail. You should handle that situation. RTFM for details.
  • Pasting all of the arguments into a string, unquoted, begs for trouble. Imaginge $line containing the string " & ; rm -rf /". Quoting is not an option, because shells tend to have different quoting rules. Use the multi-argument form of exec to avoid the shell completely.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2024-04-18 13:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found