I love Perl
Milcom:
You ever notice how malicious you can be with a just a couple of lines of
Perl?
It's staggering...
Smooches,
Wigwam
### annoy.pl ###
#!/usr/bin/perl -w
use lib '/export/home/wigwam/scripts/modules/libnet-1.19';
use Net::SMTP;
my $send_to="somebody\@somewhere.com";
my $ServerName = "smtp.somewhere.com";
my $MailFrom = "somebody_else@somewhere.com";
my $MailTo = "somebody\@somewhere.com";
my $smtp;
my $counter=0;
my $counter_minus_one=0;
for($counter=10; $counter>0; $counter--)
{
$smtp = Net::SMTP->new($ServerName);
die "Couldn't connect to server" unless $smtp;
$smtp->mail( $MailFrom );
$smtp->to( $MailTo );
# Start the mail
$smtp->data();
# Send the header.
$smtp->datasend("To: '\n");
$smtp->datasend("From: Somebody Else\n");
$smtp->datasend("Subject: $counter Bottles of Beer on the Wall\n");
$smtp->datasend("\n");
$counter_minus_one = $counter-1;
$smtp->datasend("$counter bottles of beer on the wall,\n");
$smtp->datasend("$counter bottles of beer.\n");
$smtp->datasend("If one of those bottles should happen to fall,\n");
$smtp->datasend("$counter_minus_one bottles of beer on the
wall.\n");
$smtp->dataend();
$smtp->quit;
}
exit 0;


0 Comments:
Post a Comment
<< Home