in reply to help with Net::SFTP
First point: your code and errors don't match up. The "used only once" errors indicate that you are using "use strict", but your posted code doesn't show that.
To get help effectively, there can be no mismatch between your code and the errors!
Here's what you need to do: use "my" to fix your errors, don't drop "use strict", for example:
use strict; use warnings; use Net::SFTP; my $SFTPSite = 'sftp.xxxxbroker' ; my $userid = 'fred'; my $pword = 'bedrock'; #** ** ** ** ** ** ** ** # Setup to do the SFTP my $sftp = Net::SFTP->new( $SFTPSite, $userid, $pword ) or die "Could NOT create SFTP " ; #Net::SFTP const +ructor my @entries = $sftp->ls('/'); # slurp all entries into an array foreach $entry (@entries) { print "$entry \n"; chomp $entry; my @fields = split /\s+/, $entry; print "the file name: " . $fields[-1] . "\n"; }
Then post your complete code, preferably boiled down to the smallest working portion that demonstrates your problem.
non-Perl:
read my music blog
be my fan at Reverbnation
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: help with Net::SFTP
by kevind0718 (Scribe) on Jan 15, 2008 at 18:49 UTC | |
by andyford (Curate) on Jan 15, 2008 at 19:23 UTC | |
by Anonymous Monk on Jan 15, 2008 at 20:21 UTC | |
by salva (Canon) on Jan 16, 2008 at 15:30 UTC | |
by Anonymous Monk on Feb 11, 2008 at 10:04 UTC | |
by marto (Cardinal) on Feb 11, 2008 at 10:15 UTC |
In Section
Seekers of Perl Wisdom