I'm writing a POP3 client in Perl using Mail::POP3Client (mostly to better learn Perl programming) but I am running into a wierd problem. So that long messages don't scroll off the screen, I am printing the messages to
more. However, if at any time you hit
q to quit
more, I get
Broken pipe and dumped back to the command line. This however does
not happen on another Linux box and a Solaris box that I have access to (the Linux box is almost identical in its software install). A working (or not working) example of the code is as follows:
#!/usr/bin/perl -w
use Mail::POP3Client;
use strict;
my $pop = new Mail::POP3Client( USER => "(user name omitted)",
PASSWORD => "(password omitted)",
HOST => "localhost",
AUTH_MODE => "PASS" );
my $body = $pop->Body(1);
open (MORE,"|more");
print MORE $body;
close (MORE);
$pop->Close();
I'm stumped, as it was working fine then just... stopped... I can also print the contents of a file piped through more using Perl code and quit it with q just fine. Any help?
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.