Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: emailpull.pl

by jdporter (Canon)
on Jan 10, 2007 at 20:59 UTC ( #594011=note: print w/ replies, xml ) Need Help??


in reply to emailpull.pl

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


Comment on Re: emailpull.pl
Select or Download Code
Re^2: emailpull.pl
by RyuMaou (Deacon) on Jan 10, 2007 at 21:13 UTC
    Yeah, I thought about combining the two scripts, but I could see how having emailverify.pl as a stand alone might be useful. Also, though it's not an excuse, I pulled e-mail addresses from data files totalling close to a gig, possibly more, of raw data. It was only after I collected the data that I saw how much extra sorting I was going to need to do.

    Thanks for the cleanup, though. I don't hardly get to do enough PERL these days, so my code is even sloppier than it used to be!
      ...get to do enough PERL these days...

      You mean Perl.

        Well, there goes any hope of being one of the cool kids.
        Yep, I meant Perl.

        Anyway, thanks again for scrubbing my code. Now, if I can only find more time to write more....

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://594011]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (8)
As of 2014-07-30 05:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (229 votes), past polls