G'day Ronald,

I think it's possible that we've both slightly misconstrued the other's intent and that this has been exacerbated with each response. I'll address both the general issue of system($cmd) vs. `$cmd` and then look at the more specific case raised by AM.

In general, I avoid platform-specific code. On the rare occasions when this isn't the case, I'm more likely to choose system($cmd) for exactly the reasons you state: "you communicate to the reader more clearly what's going on". I believe we're in agreement with respect to this general case of usage. If I have a reason not to use system(), I'd normally choose qx{$cmd} over `$cmd`.

AM's original question contained garbage code. I cobbled together various elements of what he had, to produce something which did what he asked for: temp_1, >>/home/administrator and `evince bill.pdf`; was munged into `evince bill.pdf >> /home/administrator/temp_1`;. I retained the append mode (>>) which he'd used although I'm not convinced that he didn't actually want write mode (>); similarly, I retained the backquotes. I stated that I didn't think he'd described what he really wanted and queried what he was using $rc for.

-- Ken


In reply to Re^5: PDF output to temp file by kcott
in thread PDF output to temp file by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.