Many good points, chomp resolved the issue but thanks for the
information in both posts, very helpful, so many things to learn yet.
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
Alex Ardin wrote:
Hi,
Hello,
I frequently have to review logs that are captured with 'script' using
terminal but these logs have many control characters.
The intent of the script is the following:
1. Get a listing of all the logs in a directory, storing the list of
files in an array.
perl
Hi Alex,
Your script should be like that:
$oldfile = $file;
chomp($oldfile);
my $newfile = $oldfile . ".x";
... as $file (and $oldfile, which is redundant btw) ends with "\n".
Besides, it'd be much easier to collect all the files in the given
directory with fileglob.
-- iD
2012/1/5 Alex Ardi
Hi,
I frequently have to review logs that are captured with 'script' using
terminal but these logs have many control characters.
The intent of the script is the following:
1. Get a listing of all the logs in a directory, storing the list of
files in an array.
2. For each filename in the array, cr