my $fh = IO::File->new($MAILBOX)
or die "unable to read mailbox '$MAILBOX': $!";
my $mail;
{
local $/;
$mail = <$fh>;
}
is probably better written as
my $mail = do
{
my $fh = IO::File->new($MAILBOX)
or die "unable to read mailbox '$MAILBOX': $!";
local $/;
<$fh>
};
That way, $fh gets automatically closed as soon as you're done reading it, and you declare and assign $mail in one step.
Also, if it was me, I'd probably sort the email addresses when printing them.
A word spoken in Mind will reach its own level, in the objective world, by its own weight
|