Click here to get back home

Chained exceptions in Perl

 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
Chained exceptions in Perl Ivan Fomichev 05-04-2007
Posted by Ivan Fomichev on May 4, 2007, 4:44 am
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
(beginner question) downsample data points using chained maps December 2, 2004, 8:30 pm
SSH2 exceptions on windows xp (perl 5.8.8) October 1, 2007, 7:06 pm
Trapping Perl divide-by-zero exceptions using eval( ) August 27, 2004, 9:25 am
perl exceptions and return value in finally block November 7, 2006, 10:26 pm
'stat' and it's exceptions November 8, 2004, 9:24 pm
database connect: protect with exceptions? September 18, 2006, 4:25 pm
Finding out the String-based Exceptions for a Module? December 12, 2006, 1:42 am
PERL to mean what 'perldoc perl' says is wrong? (was: Re: perl should be improved and perl6) April 14, 2008, 11:37 pm
FAQ 3.0: What is perl.com? Perl Mongers? pm.org? perl.org? cpan.org? October 31, 2004, 12:03 pm
FAQ 3.0 What is perl.com? Perl Mongers? pm.org? perl.org? cpan.org? February 2, 2005, 12:03 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap