Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Use of system() considered harmful

by sundialsvc4 (Abbot)
on Jun 11, 2008 at 13:23 UTC ( [id://691460]=note: print w/replies, xml ) Need Help??


in reply to Use of system() considered harmful

Strictly speaking, you can use grep -rilw system * in the source-directory to quickly locate all files which contain the bareword-delimited string "system."

To me, this is "a necessary design-decision" that the programmer must make. The ultimate goal of any program is both "to solve the problem" and "to be maintainable." Usually, I advocate putting the environment-specific stuff (like system() calls) into a separate module or package, so that everything's in one-and-only-one place. But if the system() approach appears to me to be a reasonable way to solve the problem, I'm gonna do it ... and document the hell out of it.

What I emphatically don't want is a bunch of widely-scattered and not-obvious code that is both poorly documented and causally-connected. I've fixed a'plenty of code like that... cursing the name of the original programmer (and the legitimacy of his birth-parent's relationship) all the while. ;-)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (6)
As of 2024-03-28 11:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found