Click here to get back home

running a compiled program 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
running a compiled program in perl Bob Then 05-09-2005
Posted by Bob Then on May 9, 2005, 2:49 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 A. Sinan Unur on May 9, 2005, 5:01 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
Monitor a dos console perl program running December 3, 2004, 4:01 pm
Running and Feeding Input to Interactive Program in Windows from Perl Script November 26, 2006, 12:30 pm
Detecting a program is running. May 26, 2005, 1:58 am
Running another program in daemon server June 22, 2006, 5:32 am
Finding "Undefined subroutines" before running program July 19, 2004, 2:40 am
Compiled perl executable July 7, 2008, 10:52 pm
Finding out whether perl was compiled using dynamic / static linking May 24, 2005, 5:29 am
unusual behaviour of perl script compiled with perlapp on hp-ux11i May 8, 2005, 7:52 am
Re: Simple compiled regexp not working August 30, 2006, 8:49 pm
Simple compiled regexp not working August 30, 2006, 8:40 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap