Babale Fongo wrote:
This is what I had:

@found = remote_cmds ("find $remdir  -name '*.zip'");

print "@found" look like this:

/path/file1.zip
/path/file2.zip
/path/file3.zip

@found is neither a list nor string,

That is correct, it is an array.


so it is not handy to deal with.


In scalar context, the command returns 1 (true), in list context it returns a list of files (one per line). But the value of @found is not a list,

That is correct, it is an array.

perldoc -q "What is the difference between a list and an array"


but I can't split it either.

 I tried: @splitted list = spilt /\n/, @found; # didn't work!
@splitted list = spilt / /, @found; # didn't work either

Has anyone an idea on how split the return?

I assume that you just want to remove the newline characters from the end of each array element?


chomp( @found = remote_cmds ("find $remdir  -name '*.zip'") );



John
--
use Perl;
program
fulfillment

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to