Click here to get back home

unusual behaviour of perl script compiled with perlapp on hp-ux11i

 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
unusual behaviour of perl script compiled with perlapp on hp-ux11i strepxe 05-08-2005
Posted by strepxe on May 8, 2005, 7:52 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

Posted by Anno Siegel on May 8, 2005, 8:33 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
perlapp question April 12, 2005, 7:19 pm
Compiled perl executable July 7, 2008, 10:52 pm
running a compiled program in perl May 9, 2005, 2:49 pm
Different behaviour of a german script on a french server. January 25, 2006, 10:04 am
Finding out whether perl was compiled using dynamic / static linking May 24, 2005, 5:29 am
Unusual warning - what's it trying tell me? August 22, 2005, 9:40 am
somewhat unusual way to define a sub April 7, 2008, 11:59 am
Re: Simple compiled regexp not working August 30, 2006, 8:49 pm
Simple compiled regexp not working August 30, 2006, 8:40 pm
Case-insensitive matching on compiled regex? May 10, 2006, 7:22 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap