Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • by elysch (9482) on 2009.11.09 14:20 (#71073)
    Hi. I discovered the script stores mails every time it encounters a mail beginning (^From ). So, the last e-mail is not stored since there is no "NEXT" mail. I fixed moving:

            if ( length( $message ) > 0 ) {
                    $file = $file_base . sprintf( "%02d", $file_i );
                    #print "Got message # $message_count - appending to $file ...\n";
                    if ( $need_to_write_init ) {
                            #write_initial_msg( $file );
                            $need_to_write_init = 0;

                    open( SPLIT, ">>$file" ) || die "Cannot append to $file: $!";
                    print SPLIT $message;
                    close( SPLIT );

    to a function called save_msg and calling it where the code was, and ALSO before

    close( MBOX );

    Note that I'm ignoring the variables scope, since I'm in a hurry, but I shouldn't have.

    Feel free to ask if you want me to post my script.