in reply to Mail::DeliveryStatus::BounceParse

I get "can't call method "get" on an undefined value at sqlbouncerpt.pl line 20 when I try to run it. Line 20 is print $report->get('email');

Eh, yea. It's the first and only time you use $report, so it is undef, which cannot be used as an object.

use strict; use strict; use strict; use strict; use strict; use strict; use strict;
And use warnings too!

See also a tutorial or a book. You need one.

Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }

Replies are listed 'Best First'.
Re^2: Mail::DeliveryStatus::BounceParse
by jalspach (Acolyte) on Jan 17, 2005 at 04:40 UTC
    To make sure I understand, you somewhat recommend using
    use strict; ?
    In all seriousness, I appreciate the suggestions and the pointer to the tutorial. I have started going through it and, really enjoy the way it is written.
    I have no delusions about the strength of my code. While I have written many small LAMP applications (mostly but not all, using PHP), I am (obviously) not a programmer.
    In the past I have had very good luck, learning (figuring out is a more accurate term) on the fly from the books I have on my shelf, code snippets I can find on the web and, in this case, a dose of pod2html. Most of the time I can mash them all together, make any specific changes I want, and have a working program that does what I want it to. In this case however, I seem to be shut out. My lack of real programming knowledge may have caught up to me.
    I know that the problem is not with the logic of the program (even though that could no doubt be improved) but with my attempts to call the available reports. I have placed in my main loop, a print statement that prints $body and $bounce (sounds like a shampoo commercial). The $body prints just fine (telling me that the file opens, is read and is parsed correctly) and, although all I see is a hash reference, $bounce updates as the loop runs so I know the data is getting fed into the module and it is accepting it.
    I am confident that I can figure out the last part, how to define $report so that it contains the information necessary to call $report->get('XYZ');
    I am going to go through the module code and the tutorial more tonight to see what I can turn up.

    Thanks again for the pointers;
    James

      To make sure I understand, you somewhat recommend using use strict; ?

      Nahhh... Where did you get that idea? ;)

      Both strict and warnings would have told you about the mistake with $report. This is why these tools are so valuable.

      Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }