Do you have a question? Post it now! No Registration Necessary. Now with pictures!
December 8, 2006, 10:06 am
rate this thread
I am a new bee to perl, do not know even the basics of perl.
The Scenirion, why i choose perl
I have a exe file compiled with cygwin, need to execute in different
windows machine and get the output as log files, so i chose perl to ftp
the required exe file and execute using the Telnet module. I am having
problem with Telnet as it is not returning after the completion of the
exe, it waits until the time out.
Please find the following perl code
my $BUFFER_MAX=10485760; #10 MB of Buffer
#my $tel_obj = new Net::Telnet (Timeout => 999, errmode => 'die',
my $tel_obj = new Net::Telnet (errmode => 'return', Binmode =>0);
print "Unable to telnet...\n";
print "\nINFORMATION: Connecting to Host : $ARGV";
$tel_obj->login(Name => $ARGV, Password => $ARGV);
$tel_obj->cmd(String => "cd $SOURCE_PATH");
print "\nINFORMATION: Executing the exe : $ARGV";
my $cmd_str = "perl $ARGV";
print "\nINFORMATION: Closing the connection with Host : $ARGV";
print "\nERROR: Invalid Argument Passed...\n";
It will get four parameters
$ARGV = passing a string - variable currently not used
$ARGV = Host name
$ARGV = User name
$ARGV = Password
$ARGV = script name
the script which needs to be executed contains the following lines
Thanks in advance....
Re: Telnet Problem
firstname.lastname@example.org a écrit :
I did not use Telnet, but i have a litttle experience in FTP.
To be able to log FTP action in the script, I have redirected STDERR,
and STDOUT in the same file. You can try this ..
open ( STDERR ,">>$LOG");
open (STDOUT ,">>$LOG");
select STDERR ;