in reply to local creation still triggers "requires explicit package name" error

This worked for me. I tried to condense it a little; also, I turned debugging on:
#!/usr/bin/perl use strict; use warnings; use Net::SFTP; use YAML; use YAML::Dumper; my $host = 'localhost'; my $user = 'user'; my $pass = 'password'; eval { $SIG{ALRM} = sub { die "Net::SFTP timed out\n" }; alarm 2; my $sftp = Net::SFTP->new( $host, user => $user, password => $pass, debug => 1, ); my $dumper = YAML::Dumper->new; $dumper->indent_width(4); print $dumper->dump( $sftp->ls('/usr/lib/perl5') ); }; if ($@) { chomp $@; die "Error: $@ trying to connect to CMS\n"; } else { print "All done!\n"; }
  • Comment on Re: local creation still triggers "requires explicit package name" error
  • Download Code