I have a situation where I need to run an external program.

Basically I guess what I'm doing is a kind of batch processing. I have a bunch of PDFs that I need to compress on MacOSX. I can call the program I need to run by passing it a single filename with system, but then my Perl program goes off into lala land waiting for the external program to return, but since its GUI it just sits there waiting for another file and never returning.

Is there a way to force the GUI to exit after it has processed the file I sent it? Or is there a better way to do what I'm trying to do? I've tried the whole filehandle pipe deal as shown in the Perl Cookbook, but that really doesn't do what I need to do. Since I'm not really writing to the program, just passing it another filename to work with.

Any help here will be greatly appreciated.


In reply to Running an external GUI program by mdrisser

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.