Click here to get back home

two questions about RE from perl novice.

 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
two questions about RE from perl novice. Flamingo 02-09-2007
Get Chitika Premium
Posted by Flamingo on February 9, 2007, 4:16 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
two questions about RE from perl novice. February 9, 2007, 4:16 pm
Feasibility of using Perl to strip selected html tags and/or attributes (scripting/programming novice) May 12, 2005, 2:26 pm
Absolute Novice (Mac Tiger) Needs Help February 10, 2006, 7:51 pm
Activestate/win32 novice help May 13, 2006, 5:47 pm
Novice::Help>Split IP Address(port) + count June 16, 2005, 6:34 am
some perl questions October 24, 2005, 8:18 am
newbie perl questions January 21, 2005, 11:31 pm
Questions about Perl for Windows February 28, 2005, 7:24 pm
Categories of Perl questions March 7, 2005, 5:15 pm
Which is the perl questions ng for beginners July 3, 2006, 8:16 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap