Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

MIME::Parser

by stew (Scribe)
on Nov 12, 2003 at 15:03 UTC ( [id://306536]=perlquestion: print w/replies, xml ) Need Help??

stew has asked for the wisdom of the Perl Monks concerning the following question:

Hi there,

Further to my earlier post I'm trying to make headway with MIME::Parser I've tried to make myself familiar with various examples but to no avail. Even the most basic example yeilds the following error.

readline() on unopened filehandle DATA at /usr/local/lib/perl5/site_perl/5.6.1/MIME/WordDecoder.pm line 579.

Example:

#!/usr/bin/perl -W use strict; $|++; use MIME::Parser; use MIME::Entity; my $envelope = <STDIN>; my $parser = MIME::Parser->new; $parser->output_to_core(1); $parser->tmp_to_core(1);


Any ideas what I'm doing wrong

Humbly yours
./stew

Replies are listed 'Best First'.
Re: MIME::Parser
by ChrisR (Hermit) on Nov 12, 2003 at 15:22 UTC
    If you change the shebang line to #!/usr/bin/perl -w (notice the lowercase w), this error does not occur. I'm not sure what the difference is between lowercase and uppercase w in the shebang line but I'm looking that up now.
    Update
    -w prints warnings...
    -W "Unconditionally and permanantly enables all warnings throught the program, even if warnings were disabled locally using no warnings or $^W = 0. This includes all files loaded via use, require, or  do." from the Camel Book

    I haven't checked but it could be possible that the author turned off warnings intentionally.

    I use
    use MIME::Parser; use MIME::Entity; use MIME::WordDecoder; use MIME::Body; use MIME::Base64; use MIME::QuotedPrint;
    quite a bit in a an email program I wrote and have no problems or warnings but then again I use -w instead of -W
      That has indeed done the trick, thank you very much

      ./stew

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://306536]
Approved by barrd
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2024-04-20 03:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found