Click here to get back home

executing code without exiting the interpreter

 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
executing code without exiting the interpreter nikolas pontikos 04-01-2007
Posted by nikolas pontikos on April 1, 2007, 4:35 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 Mirco Wahab on April 1, 2007, 5:14 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
Exiting without printing December 22, 2005, 8:48 pm
How can I prevent perl from exiting during a network error? May 8, 2005, 9:32 am
Problem with loop control LAST exiting prematurely March 18, 2008, 6:22 am
How to stop perl from exiting when stat($_)->size fails February 15, 2006, 11:50 am
SSI executing Perl September 14, 2004, 4:56 pm
Executing cmd from perl script September 8, 2004, 9:49 pm
cgi scripts stops executing? January 20, 2005, 12:56 pm
executing a bat file from a web page April 21, 2006, 10:13 pm
threads not executing @ same time September 28, 2006, 2:13 am
Executing awk from perl script March 24, 2007, 12:55 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap