David T-G wrote: > Hi, all -- > > I'm having some trouble using this wonderful-looking module to tackle > catching bounced mail and doing something with it. I've followed the > man page to a tee but get errors. > > Figuring that y'all can find the man page or don't need it, here is my > basic script (with strict and warnings turned on above): > > ... > my $bounce = eval { Mail::DeliveryStatus::BounceParser->new ( \*STDIN ) } ;$ > if ( $@ ) > { print "Whoa -- one we actually couldn't handle!\n" ; exit 255 ; } > my @addresses = $bounce->addresses; # email address strings ### > my @reports = $bounce->reports; # Mail::Header objects ### > my $orig_message_id = $bounce->orig_message_id; # "<[EMAIL PROTECTED]>" string > ### > my $orig_message = $bounce->orig_message; # Mail::Internet object ### > > print "WE HAVE orig_message_id AS .$orig_message_id.\n"; ### > print "WE HAVE orig_message AS .$orig_message.\n"; ### > > This works well enough except that $orig_message seems to be empty; well, > I had an orig message in there but I'm not too worried about that at the > moment.
I would suggest that you do. Programs do not generally work well if the data is not getting into the variables. > The real problem is when I go on to say: > > print "arrival-date: " ; print $report->get('arrival-date'); print "\n" ; > > and it pukes with > > Global symbol "$report" requires explicit package name at ./catch-bounced-mail.pl > line 32. What am I missing? I look at the code posted, and see no declaration for any scalar $report? Is there some reason you expect the compiler to recognize this identifier? > What do I need to do to get to each of these reports? which reports? The ones stored in the properly declared array @reposts? foreach my $report (@reports) { $report->do_something(); } Joseph -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]