good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: Use of system() considered harmfulby zentara (Archbishop) |
on Jun 07, 2008 at 15:51 UTC ( [id://690842]=note: print w/replies, xml ) | Need Help?? |
Anything that forks off, or executes an external program can be unpredictable...... but I would rather have it easy to use and test it myself before use, than have Perl prohibit me from doing it, like in cgi taint mode. The testing for correctness extends further too, when you pass in an @args, like system('/bin/foo',@args), how can you be sure how foo is parsing @args? I've seen weird input processing where you need to explicitly specify input pairs, like system('/bin/foo','-p bar','-z wham', '-x ','one two three') So in other words, Perl makes it easy for 99% of cases, but you need to be careful, and it's up to the programmer to watch for errors, with something along the lines
I have this snippet saved from ChemBoy which may be useful
I'm not really a human, but I play one on earth CandyGram for Mongo
In Section
Meditations
|
|