Click here to get back home

Higher-Order Perl: The Quest for an Accessible Version, Initial Impressions (Long)

 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
Higher-Order Perl: The Quest for an Accessible Version, Initial Impressions (Long) Veli-Pekka Tätilä 04-01-2006
Get Chitika Premium
Posted by Veli-Pekka Tätilä on April 1, 2006, 7:12 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 DJ Stunks on April 2, 2006, 12:21 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 Veli-Pekka Tätilä on April 2, 2006, 4:48 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
Version? Getopt::Long October 4, 2004, 3:00 pm
Perl debugger has wrong initial entry point and line numbers February 9, 2005, 11:02 am
IO::Socket Stop listening for new connections after initial connection January 13, 2006, 12:54 pm
'long long integer' in Perl February 15, 2006, 2:30 pm
Hash in inherited object fields not properly accessible (5.8.6, RH 7.3) August 4, 2006, 8:26 pm
Replacing the SMTP.pm 2.13 version with the 2.29 version October 18, 2005, 12:02 am
How long is too long for cgi script? April 22, 2005, 12:07 pm
How to unpack long long ? June 12, 2008, 9:51 am
How to unpack long long ? June 12, 2008, 9:52 am
FAQ 1.3 Which version of Perl should I use? January 8, 2005, 6: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