c84032002 has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use strict; use Net::SFTP; my $host = 'sftp.section111.cms.hhs.gov'; my $user = 'myUser'; my $pass = 'myPass'; #open connection eval { #timeout if no response within 120 seconds $SIG{ALRM} = sub {die "Net::SFTP timed out\n"}; alarm(120); my $sftp = Net::SFTP->new($host,user =>$user,password=>$pass, ssh_args=>[port=>10022],debug =>0) || die "Can't connect $ [at] \n" +; alarm(0); }; if ($@) { alarm(0); chomp( $@ ); die("Error: $@ trying to connect to CMS \n"); } else { $sftp->ls("/000014928/response/prod/query-only" , sub { print $_[0] +->{longname}, "\n" }); die("Success: $@ has connected to CMS \n"); } /csapps055/gentran/test/script $ demo5.pl Global symbol "$sftp" requires explicit package name at demo5.pl line +25. Execution of demo5.pl aborted due to compilation errors.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: local creation still triggers "requires explicit package name" error
by choroba (Cardinal) on May 28, 2010 at 15:46 UTC | |
by c84032002 (Novice) on May 28, 2010 at 15:54 UTC | |
by FunkyMonk (Bishop) on May 28, 2010 at 16:15 UTC | |
by Anonymous Monk on May 28, 2010 at 16:20 UTC | |
|
Re: local creation still triggers "requires explicit package name" error
by Khen1950fx (Canon) on May 29, 2010 at 06:13 UTC |