THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
No Format |
---|
#!/usr/bin/perl # # splits a file containing multiple messages into individual files # use strict; sub splitmail { my $infile = shift; my $outdir = shift; my $count = 0; open(INFILE, "< $infile") or die "Can't open $infile: $!\n"; while(<INFILE>) { /^From / and do { close(OUTFILE) if $count; open(OUTFILE, "> $outdir/$count") or die "Can't open $outdir/$count: $!\n"; $count++; }; print OUTFILE $_; } close(OUTFILE); } 1; |
...