Click to See Complete Forum and Search --> : perl file is running twice


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?

jimr451
03-18-2009, 12:45 PM
When you say "running twice" - do you mean it's sending two emails, or something else?