in reply to Re^3: Net::FTP usage
in thread Net::FTP usage

I updated the @array to @xfiles which is the new glob array. The FTP process worked! The files appeared at the right location. Results of the found command you coded:
Found file /ccifas/tempifas/AU/sudolog_2010Jul_infodevl
Found file /ccifas/tempifas/AU/sudolog_2010Jul_infoprod
Found file /ccifas/tempifas/AU/sudolog_2010Jul_infoprodx
Found file /ccifas/tempifas/AU/sudolog_2010Jul_infoqual
Found file /ccifas/tempifas/AU/sudolog_2010Jul_infostag
Is the $f =~ s/\s+$// ; statement doing the chomp function? Can you expand on the statement and tell me is it editing out whitespaces?

Thank you, Corion for your help and understanding. I would probably never have solved this without you and the Perl Monks! Ken

Replies are listed 'Best First'.
Re^5: Net::FTP usage
by Corion (Patriarch) on Aug 13, 2010 at 15:02 UTC
Re: Net::FTP usage
by jonadab (Parson) on Aug 13, 2010 at 18:48 UTC
    Is the $f =~ s/\s+$// ; statement doing the chomp function?

    In this context, it's probably accomplishing more or less what the chomp would have been intended to accomplish. There are however technical differences, e.g., the + causes the substitution to remove as much trailing whitespace as it can find, so if the line ends with twenty-seven spaces in a row followed by three tab characters, a carriage return, and a line feed, they'll all be taken off; chomp would probably only take the CRLF, or maybe even just the linefeed, depending on the value of $/.

    For more details about the substitution, read the chapter on regular expressions in your favorite Perl book. Don't worry too much about chomp for now (until you have been using Perl for a while longer); if you know how to use s///, you can probably get by without chomp for the time being. (Regular expressions, on the other hand, are pretty much impossible to live without. The internet as we know it could more likely exist without integrated circuits than without regular expressions.)