Click here to get back home

Simple Structure Question

 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
Simple Structure Question one man army 06-26-2005
Posted by one man army on June 26, 2005, 8:23 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
newbie structure question October 5, 2006, 7:49 pm
Directory structure question April 4, 2007, 8:31 pm
Question about this data structure... September 24, 2007, 8:33 pm
Simple question September 2, 2004, 5:12 pm
A hopefully simple question February 16, 2005, 3:00 pm
a simple =~ // question May 22, 2005, 10:33 am
a simple question May 30, 2005, 4:02 pm
Simple DBD question November 16, 2005, 6:28 am
CGI.PM Very very simple question December 1, 2005, 3:18 pm
XML::Simple question January 21, 2006, 3:45 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap