in reply to Net::SFTP listing problem

my $ls = $sftp->ls or die "unable to retrieve directory: " . $sftp->er +ror; my @long = map $_->{longname}, @$ls; print Dumper(\@long);

Replies are listed 'Best First'.
Re^2: Net::SFTP listing problem
by sunnyfedora99 (Novice) on Oct 05, 2011 at 14:35 UTC

    How can I make it  return $long instead of  return @long. I call the $long variable in another sub

      my $long = [ map $_->{longname}, @$ls ]; print Dumper($long);

      No worries, I got it. Just wrapped it in Square brackets.

      cheers