#!/usr/bin/perl use Mail::POP3Client; use strict; use Misc; #Creating PopMail Object my $pop = new Mail::POP3Client( USER => "RESU", PASSWORD => "DROWSSAP", HOST => "tsoh.com"); my @linkList=slurp("linkList.inc"); for (my $i=1; $i <= $pop->Count(); $i++) # Loop through messages { my $body = $pop->Body($i); while ($body =~ s/(http:\/\/[^\s]*)//) { push @linkList, $1; print "$1\n"; } $pop->Delete($i); } $pop->Close(); dumpOut("linkList.inc", @linkList); exit 0; ########################### sub slurp { my $file =shift; my $save = $/; undef $/; open FIL, "$file"; my $input= ; close FIL; my @list = split /$save/, $input; $/ = $save; return @list; } sub dumpOut { my $file = shift; open FIL, "|uniq >$file"; while(my $content = shift) { print FIL $content, "\n"; } close FIL; }