What's discouraged (much of the time)
Only by some people
is often more costly than using the Perl equivalent/variant.
So what? In many cases, it doesn't matter.
Note also he's using sed to strip off some of the output of ps. I'm sure someone made a module somewhere that mimics all the flavours of ps, but I rather spend a few microseconds forking and execing a 'ps', then I go hunting down said module, download and install it, and learn how it works.
There can be all kinds of reasons one does something in Perl instead of shelling out. But being considered "discouraged" by some doesn't strike me as an important reason.
But that may be just me.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|