jueves, noviembre 18, 2004
My own GMail notifier
#!/usr/bin/perl
use Mail::POP3Client;
$pop = new Mail::POP3Client(
USER => $ENV{GMAIL_USER},
PASSWORD => $ENV{GMAIL_PASS},
HOST => 'smtp.gmail.com',
PORT => 995,
USESSL => 'true',
);
my $count = $pop->Count;
my $plural = $count == 1 ? [ 'is', '' ] : [ 'are', 's' ];
print '$ENV{GMAIL_USER}: There $$plural[0] $count' .
' message$$plural[1]\n';
$pop->Close();"