Click here to get back home

Help with File::Path rmtree

 HomeNewsGroups | Search | About
 comp.lang.perl.misc    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
Help with File::Path rmtree jbl 08-07-2005
Get Chitika Premium
Posted by jbl on August 7, 2005, 12:25 pm
Please log in for more thread options
>>
>> [snip]
>>
>> > if I print "$1\n",
>> > the file prints just fine. But, if I do something like print "$1 after
>> > \n", the whole output is messed up. If I print "before $1\n", nothing
>> > prints at all. If I print "before $1 after\n", only after prints.
>>
>> not really sure, but could be a rogue "\r" in $1,


> There
> is a rogue carriage return (0xd) in the string

> Is there something I can do to deal with this
> situation?


Repair the corrupted file:

perl -p -i -e 'tr/\r//d' bad_file


--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas

Posted by John W. Krahn on August 7, 2005, 2:34 pm
Please log in for more thread options
>>
>> [snip]
>>
>> > if I print "$1\n",
>> > the file prints just fine. But, if I do something like print "$1 after
>> > \n", the whole output is messed up. If I print "before $1\n", nothing
>> > prints at all. If I print "before $1 after\n", only after prints.
>>
>> not really sure, but could be a rogue "\r" in $1,


> There
> is a rogue carriage return (0xd) in the string

> Is there something I can do to deal with this
> situation?


Repair the corrupted file:

perl -p -i -e 'tr/\r//d' bad_file


--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas

Similar ThreadsPosted
using wildcards in rmtree or blog on windows July 15, 2004, 12:48 pm
How to push some file to user, without show path of file? December 1, 2005, 6:17 pm
how to find the path of the file July 13, 2006, 4:38 pm
read path from a file April 6, 2007, 8:09 am
Cant open a file with just a relative path April 24, 2007, 4:04 pm
compacting '..' path segments using File::Spec February 1, 2005, 12:29 am
extraction of multiple extensions of a file path name ... June 22, 2006, 7:22 am
A script to separate out file names from the path? December 11, 2006, 3:15 pm
Perl-Python-a-Day: split a file full path October 16, 2005, 7:00 pm
embedded perl path $ENV problem September 22, 2004, 4:29 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap