perl-module

can't ssh:unable to establish master SSH connection: bad password or master process exited unexpectedly

南笙酒味 提交于 2021-01-28 04:13:18
问题 I have problem with perl modules, i 'm trying to connect to the remote server using the OpenSSH module from CPAN and i have given the username and password correctly but when i run my CGI from browser i see the following error message " can't ssh:unable to establish master SSH connection: bad password or master process exited unexpectedly in need of immediate reply's and awaiting, Thanks in Advance. Here is my code #!/usr/bin/perl -w use CGI; use Data::Dumper; use strict; use CGI::Carp qw

Calling a Perl Module which is Installed in different path/directory

删除回忆录丶 提交于 2020-12-06 04:27:08
问题 I am writing a Perl script which does - SSH to one of the server and do some operation using Net::OpenSSH Perl Module. I want to have entire log of the script to be stored in certain log file using Log::Log4perl Perl Module. I want to write some data to CSV file using Text::CSV Perl Module. Actually these three Perl Modules have been installed in different directories. Lets say - Net::OpenSSH is installed in /path/to/lib1 Log::Log4perl is installed in /path/to/lib2 Text::CSV is installed in

In Perl, how can I access a scalar defined in another package?

左心房为你撑大大i 提交于 2020-01-23 06:53:47
问题 I seem to be stuck trying to access a scalar which is defined in another package, and have narrowed down an example to a simple test case where I can reproduce the issue. What I wish to be able to do it access a reference to a list which is in defined within the package 'Example', using the our mechanism, however, Dumper is showing that the variable is always undefined within example.pl: Example.pm looks like the following: #!/usr/bin/perl -w use strict; use warnings; use diagnostics; package

In Perl, how can I access a scalar defined in another package?

a 夏天 提交于 2020-01-23 06:53:26
问题 I seem to be stuck trying to access a scalar which is defined in another package, and have narrowed down an example to a simple test case where I can reproduce the issue. What I wish to be able to do it access a reference to a list which is in defined within the package 'Example', using the our mechanism, however, Dumper is showing that the variable is always undefined within example.pl: Example.pm looks like the following: #!/usr/bin/perl -w use strict; use warnings; use diagnostics; package

Defining common variables across multiple scripts?

那年仲夏 提交于 2020-01-21 08:50:30
问题 I have a number of Bash and Perl scripts which are unrelated in functionality, but are related in that they work within the same project. The fact that they work in the same project means that I commonly specify the same directories, the same project specific commands, the same keywords at the top of every script. Currently, this has not bitten me, but I understand that it would be easier to have all of these values in one place, then if something changes I can change a value once and have

How long has a module been in Perl core?

▼魔方 西西 提交于 2020-01-21 06:33:08
问题 The module I'm actually interested in is Sys::Hostname, but as a more general question, how can I tell how long a particular module has been a core module? I'm curious about this with regards to the Perl version. 回答1: Would Module::CoreList help? From withing Perl: print Module::CoreList->first_release('Sys::Hostname'); From the command line: corelist -d Sys::Hostname 来源: https://stackoverflow.com/questions/7259258/how-long-has-a-module-been-in-perl-core

Does Perl have a module similar to docopt?

ぐ巨炮叔叔 提交于 2020-01-14 14:18:25
问题 Is there any Perl module that have similar functionality to Docopt or is there a port being developed for it? Docopt is a module that creates an interface for command line calls from parsing the usage and options messages. You create the standard help message like Naval Fate. Usage: naval_fate ship new ... naval_fate ship move [--speed=] naval_fate ship shoot naval_fate mine (set|remove) [--moored|--drifting] naval_fate -h | --help naval_fate --version Options: -h --help Show this screen. -

how to find duplicate file name using file:find?

扶醉桌前 提交于 2020-01-06 14:16:26
问题 I am trying to write a program to find duplicate file names in multiple drive using perl. This is my script, but it gives wrong info. #!/usr/bin/perl use File::Find; @filename; @path; $count; open my $out, '>', 'output.txt' or die $!; my $file = "E:"; find( \&edit, "$file" ); sub edit() { $count++; push( @filename, $_ ); push( @path, $File::Find::name ); } print "Processing."; for ( my $i = 0 ; $i < $count ; $i++ ) { for ( my $j = $i + 1 ; $j < $count ; $j++ ) { if ( $filename[$i] =~ /\Q

Perl convert date timezone without datetime module

只愿长相守 提交于 2020-01-06 06:34:08
问题 I have a date in the format: 05/26/2013 06:08:00 The timezone of above date is GMT -7 how can i change the above to GMT date and time and in format: 26 May 2013 13:08:00 GMT Note: I cannot install any perl module. I know that i can do this easily via DateTime but i cannot install it. Thanks. 回答1: You can use Time::Piece which should be included with your Perl installation. use Time::Piece; my $datetime = '05/26/2013 06:08:00'; $datetime .= '-0700'; # attach the timezone offset my $dt = Time:

Unable to install Math::Pari module

半世苍凉 提交于 2020-01-05 04:20:09
问题 I am trying to install Crypt::Random module, a cryptographically secure random number generator, and says it requires Math::Pari 2.001802, which is not availible from cpan.org, but says it is available from this other URL, which does not work. I tried to install them both anyway and encountered this problem: C:\Users\Jlinne\Documents> cpanm Crypt::Random --> Working on Crypt::Random Fetching http://www.cpan.org/authors/id/V/VI/VIPUL/Crypt-Random-1.25.tar.gz ... OK Configuring Crypt-Random-1