Wow, I am befuddled. Here's a minimal case demonstrating the problem. The follow code runs fine
use strict; use Data::Dumper; use Net::SSH::W32Perl; use Net::SFTP; use Memoize; my $host = 'xxxxxx'; my $user = 'xxxxx'; my $password = 'xxxxxx'; my $sftp = Net::SFTP->new( $host, user => $user, password => $password, debug => 0, protocol => 2 );
But if I use GetOpt::Declare,
use strict; use Data::Dumper; use Net::SSH::W32Perl; use Net::SFTP; use Memoize; use GetOpt::Declare; my $host = 'xxxxxx'; my $user = 'xxxxx'; my $password = 'xxxxxx'; my $sftp = Net::SFTP->new( $host, user => $user, password => $password, debug => 0, protocol => 2 );
all hell breaks loose and I get heaps of complaints
C:\TWO\scratch>perl sftp.pl "makerandom" is not exported by the Crypt::Random module "makerandom_itv" is not exported by the Crypt::Random module "makerandom_octet" is not exported by the Crypt::Random module Can't continue after import errors at C:/APPS/Perl/site/lib/Crypt/Rand +om/Generator.pm line 12 BEGIN failed--compilation aborted at C:/APPS/Perl/site/lib/Crypt/Rando +m/Generator.pm line 12, <GEN0> line 1. Compilation failed in require at C:/APPS/Perl/site/lib/Crypt/Random.pm + line 18, <GEN0> line 1. BEGIN failed--compilation aborted at C:/APPS/Perl/site/lib/Crypt/Rando +m.pm line 18, <GEN0> line 1. Compilation failed in require at C:/APPS/Perl/site/lib/Crypt/DH.pm lin +e 6, <GEN0> line 1. BEGIN failed--compilation aborted at C:/APPS/Perl/site/lib/Crypt/DH.pm + line 6, <GEN0> line 1. Compilation failed in require at C:/APPS/Perl/site/lib/Net/SSH/Perl/Ke +x/DH1.pm line 13, <GEN0> line 1. BEGIN failed--compilation aborted at C:/APPS/Perl/site/lib/Net/SSH/Per +l/Kex/DH1.pm line 13, <GEN0> l ine 1. Compilation failed in require at C:/APPS/Perl/site/lib/Net/SSH/Perl/Ke +x.pm line 6, <GEN0> line 1. BEGIN failed--compilation aborted at C:/APPS/Perl/site/lib/Net/SSH/Per +l/Kex.pm line 6, <GEN0> line 1 . Compilation failed in require at C:/APPS/Perl/site/lib/Net/SSH/Perl/SS +H2.pm line 6, <GEN0> line 1. BEGIN failed--compilation aborted at C:/APPS/Perl/site/lib/Net/SSH/Per +l/SSH2.pm line 6, <GEN0> line 1. Compilation failed in require at C:/APPS/Perl/site/lib/Net/SSH/W32Perl +/SSH2.pm line 7, <GEN0> line 1 . BEGIN failed--compilation aborted at C:/APPS/Perl/site/lib/Net/SSH/W32 +Perl/SSH2.pm line 7, <GEN0> li ne 1. Compilation failed in require at C:/APPS/Perl/site/lib/Net/SSH/Perl.pm + line 55, <GEN0> line 1. C:\TWO\scratch>
Never seen behavior like this before... how or why is GetOpt::Declare upsetting Net::SFTP?

???

rkg


In reply to Net::SFTP name space conflict with GetOpt::Declare? by rkg

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.