PDA

View Full Version : Need help with Perl, Plink, SSH and Windows



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.

Ricky
Wed Mar 2nd, 2011, 01:32 PM
I don't know enough about perl to be of any help here.

Go to www.stackoverflow.com and post it there. You'll have an answer in no time. It's my favorite place to post code examples and have others critique them.

Airreed
Wed Mar 2nd, 2011, 01:35 PM
ctrl + alt + delete

or

click + click = boom

I have no idea what you are talking about...

rforsythe
Wed Mar 2nd, 2011, 07:06 PM
I'm not all about Perl on windows, but more context (i.e. what your intended flow is supposed to accomplish, and the entire script) would be useful. PM me if you don't want to have it here in public. No guarantees, but my UNIX Perl-fu is pretty strong.