Mail-Toaster

 view release on metacpan or  search on metacpan

bin/qqtool.pl  view on Meta::CPAN

243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
my ( $tree, $id ) = @_;
my %hash;
 
my ($FILE, $header);
 
# a better way to read in the headers
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.330 second using v1.01-cache-2.11-cpan-55f5a4728d2 )