Hi,
here is my script:
If I run the script in debug mode, it works perfectly if even I give "c" option (it creates stam file), but if I try to run it without -d option, it doesn't create the file (no error messages)
What is wrong? What is so different between running in debug mode?
Thanks in advance
here is my script:
Code:
#!/usr/local/bin/perl -d use Net::Telnet; my $res = ""; my $ip = "10.120.7.95"; my $user = "autorun"; my $pass = "autorun"; my $env = "stam"; $tnt = Net::Telnet->new ( Timeout => 60, Prompt => '/.*(>|\$|\#|:)\s*/', Errmode=>'die' ) or $res = "ERROR: Could not initialize telnet: $!"; $tnt->open ($ip) or $res .= "ERROR: Could not open connection to $ip: $!"; $tnt->login($user,$pass) or $res .= "ERROR: Could not login to $ip: $user with $pass $!"; $tnt->waitfor('/.*(>|\$|\#|:)\s*/'); if ($res eq "") { &Cmd("ls >stam"); } if ($res =~ /Error/i) { print $res; } sub Cmd { print ">cmd\n"; my $cmd = shift; $tnt->buffer_empty; print $tnt->cmd("cd autotest"); print $tnt->cmd("setenv DISPLAY $ip:0.0"); print $tnt->cmd($cmd); print "<cmd\n"; }
What is wrong? What is so different between running in debug mode?
Thanks in advance
Comment