Mail-Toaster

 view release on metacpan or  search on metacpan

bin/qqtool.pl  view on Meta::CPAN


    my ( $tree, $id ) = @_;
    my %hash;

    my ($FILE, $header);

    # a better way to read in the headers
    # from http://perl.plover.com/lp/Spam.html
    if ( open $FILE, '<', "$qdir/mess/$tree/$id" )
    {
        local $/ = "";     # enable localized slurp mode
    	$header = <$FILE>; # read in the message headers
    	undef $/;          # reset it back to normal
    	#$body = <STDIN>;
    };

    foreach my $line ( split /\n/, $header ) {
        #print "$line\n"; sleep 1;
        if ( $line =~ /^([a-zA-Z\-]*):\s+(.*?)$/ ) {
            print "header: $line\n" if $opt_v;
            $hash{$1} = $2;



( run in 0.331 second using v1.01-cache-2.11-cpan-fb7fbe3ddfd )