Re: Appending extra characters to file name

2012-01-06 Thread Alex Ardin
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/

Re: Appending extra characters to file name

2012-01-05 Thread John W. Krahn
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

Re: Appending extra characters to file name

2012-01-05 Thread Igor Dovgiy
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

Appending extra characters to file name

2012-01-05 Thread Alex Ardin
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