How do we configure SSH using Perl in Windows?

后端 未结 3 372
野的像风
野的像风 2020-12-10 16:00

Can anyone suggest a a very simple way to use Net::SSH::Perl in Windows without all those cygwin hacks and all.

Whenever I am trying to install the modules it\'s tak

3条回答
  •  萌比男神i
    2020-12-10 16:50

    The answer about using Perl from within Cygwin then calling it from the Windows command line is the correct answer. THANKS VERY MUCH FOR YOUR EFFORT!

    However, this method to call a PERL instance running in Cygwin from the Windows Command Line is not always optimum:

    c:\cygwin\bin\perl.exe myscript.pl

    That technique will work with some Perl scripts but not all. It was giving me heck trying to use NET:SSH:EXPECT and the login() method. It would abort with strange errors.

    A better way to call your Perl instance running in Cygwin from the Windows command prompt is this:

    c:\cygwin\bin\bash --login -c 'perl myscript.pl'

    This seems to execute the Perl script fully within the Cygwin environment and even complicated Perl scripts or those with many dependencies or not capable of dealing with MSDOS style path names, will still run. You can still return the output of the Perl script back to the Windows command window, for instance using print() from within your Perl script.

提交回复
热议问题