bornwildnfree
Wed Mar 2nd, 2011, 12:33 PM
I have this problem across several Perl scripts. I have to use plink to ssh into a device. I am running Active Perl 5.10.0 Build 1004 on Windows Server 2003 with Putty release .056.
If I run the command this way:
$svctask = "plink.exe -ssh -l $user -i $svckey -2 $IP svcinfo lshost -delim :";
@shstlist = qx ($svctask) or die "Unable to open SVC\n";
print "Enter a \n";
print "\t1) WWPN\n";
print "\t2) Server name\n";
print "\n\t ?";
do
{
chomp($choice = <>);
$choice = uc($choice);
}until($choice =~ m/[0-9]{1}/);
The script hangs and I can not make a choice. I have to CTRL C out which does me no good. If I move the plink command below the until statement, I am able to make a choice and the script continues until I have another pause for answer section and again it hangs. Is there a perl command that exits out of plink? I have used this same bit of code in other scripts that don't require SSH and it works just fine.If anyone can help that would be awesome or if anyone knows someone who is really good with perl I'd happily provide beer for the help.
If I run the command this way:
$svctask = "plink.exe -ssh -l $user -i $svckey -2 $IP svcinfo lshost -delim :";
@shstlist = qx ($svctask) or die "Unable to open SVC\n";
print "Enter a \n";
print "\t1) WWPN\n";
print "\t2) Server name\n";
print "\n\t ?";
do
{
chomp($choice = <>);
$choice = uc($choice);
}until($choice =~ m/[0-9]{1}/);
The script hangs and I can not make a choice. I have to CTRL C out which does me no good. If I move the plink command below the until statement, I am able to make a choice and the script continues until I have another pause for answer section and again it hangs. Is there a perl command that exits out of plink? I have used this same bit of code in other scripts that don't require SSH and it works just fine.If anyone can help that would be awesome or if anyone knows someone who is really good with perl I'd happily provide beer for the help.