Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Re^3: Doing an 'ls' in SFTP:Foreign

by salva (Abbot)
on Feb 16, 2013 at 08:45 UTC ( #1019021=note: print w/ replies, xml ) Need Help??

in reply to Re^2: Doing an 'ls' in SFTP:Foreign
in thread Doing an 'ls' in SFTP:Foreign

Different modules, different APIs.

Retrospectively, having ls return an array reference, was probably a bad idea, bad it is too late to change it now.

Comment on Re^3: Doing an 'ls' in SFTP:Foreign
Download Code
Replies are listed 'Best First'.
Re^4: Doing an 'ls' in SFTP:Foreign
by StarkRavingCalm (Sexton) on Feb 16, 2013 at 19:28 UTC
    What do you suggest to achieve the same results?
      I suggest realizing that it returns a reference to an array of hashrefs. If you don't know what that is, read the docs that I've already linked to. You must deference the result to achieve the result you desire. There are even examples within this thread of posts somewhere. Example:
      my $result = $sftp->ls(...); foreach my $f (@$result) { ... }

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1019021]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (6)
As of 2015-10-10 15:33 GMT
Find Nodes?
    Voting Booth?

    Does Humor Belong in Programming?

    Results (257 votes), past polls