RobbieGarrett
03-17-2009, 11:55 AM
Hey all,
the following code is being run twice reguardless of I cat a file to it or just excute it with ./
#!/usr/bin/perl -s
use strict;
use Net::SMTP;
my $pid = open (PIPE, "|-");
my $smtp = Net::SMTP->new(localhost,
Hello => 'mail.test.com',
Timeout => 30,
Debug => 1,
);
$smtp->mail('system@localhost.com);
$smtp->recipient(you@testing.com);
$smtp->data();
while ( <STDIN> )
{
$smtp->datasend("$_");
}
close(PIPE);
$smtp->dataend();
$smtp->quit();
can anyone tell me why?
the following code is being run twice reguardless of I cat a file to it or just excute it with ./
#!/usr/bin/perl -s
use strict;
use Net::SMTP;
my $pid = open (PIPE, "|-");
my $smtp = Net::SMTP->new(localhost,
Hello => 'mail.test.com',
Timeout => 30,
Debug => 1,
);
$smtp->mail('system@localhost.com);
$smtp->recipient(you@testing.com);
$smtp->data();
while ( <STDIN> )
{
$smtp->datasend("$_");
}
close(PIPE);
$smtp->dataend();
$smtp->quit();
can anyone tell me why?