It might be mutually instructive to know a little more about the context around this problem. Why do you need to do this from within a perl application, as opposed to simply doing it in a shell window as a normal command line?

For example, if you happen to be using unix/x-windows, and the perl script is providing some convenient controls on file selection, then a nice work-around within your perl script could be:

... system( "xterm -e 'zcat $file | less' &" ); ...
That fires up a fresh xterm running as a background job (control returns to the perl script while the xterm stays up); the xterm is running a command where the output of zcat is being fed to "less" (not more); when the user hits "q" or some other means for quitting less, the xterm goes away, but until then, the user can browse the file contents indefinitely, and continue using the perl script to bring up more files in other windows, as needed. I use this strategy a lot.

I expect there's a way to do the same thing with ms-windows -- i.e. without x-windows/xterm -- assuming you have ms-win versions of a unix-like shell and the command line tools involved.


In reply to Re: Open a Compressed File and Piping to More by graff
in thread Open a Compressed File and Piping to More by Dru

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.