IPC::Run3::Shell already looks much better, but I'd opt to use it primarily for non-standard executables which can't be implemented in Perl.
Agreed, and I wouldn't normally shell out to things that Perl can do natively either. Sometimes, if I'm writing a one-off script that's not meant for production, I might call find, but then again I've started using File::Find::Rule more often (even though I've measured it and it's not nearly as fast as File::Find or find). Anyway, I grepped my code and here are two examples of how I've actually used the module, in the first one I remember that in that particular case, simply calling the convert program was much faster to implement than getting Image::Magick set up. Especially if the scripts are not meant for a production environment, speed of development is often what it's about; depending on what one has the most experience with, remembering or looking up the command-line arguments can be faster than finding the appropriate Perl module.
use IPC::Run3::Shell { fail_on_stderr=>1 }, qw/convert/;
convert $img, '-auto-orient', '-resize', '300x300', $thumb;
use IPC::Run3::Shell qw/gs/;
gs({fail_on_stderr=>1,show_cmd=>1},
'-o',$OUTPUT, '-sDEVICE=pdfwrite', ..., '-f',$INPUT);
Update: Minor re-wording.
-
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.