Hi there,
I'm writing a MORE type filter partly as an exercise, and partly because I'm on WinNT and am jealous of the Unix one...
I'm using the Diamond operator in the script (call it pager.pl):
while (<>) { # do stuff }
The filter "works" on the input if I use the file or command to filter as a parameter of the script, e.g.:
pager "dir|"
But it doesn't if I try to redirect the output of a command to it, e.g.:
dir |pager
In this case the script runs, but it doesn't process the output from the file or command.
Where has the output gone? (not to @ARGV, @_ or <STDIN>, as far as I can work out!)
(Sorry if this has been covered, I may have looked for the wrong thing in Supersearch)
I'm also having alternate fun and frustration with Win32::Console, but thereby hangs another post I think...
Cheerio!
Osfameron
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.