Click here to get back home

how to enforce mutual exclusion in win32

 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
how to enforce mutual exclusion in win32 chaojen.chen 06-06-2006
Get Chitika Premium
Posted by chaojen.chen on June 6, 2006, 11:26 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 Ben Morrow on June 6, 2006, 12: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

Similar ThreadsPosted
Global Pension Plan (GPP) Mutual Strategic March 27, 2008, 11:03 am
regex ip address exclusion April 27, 2005, 2:48 pm
Dave Roth's site (Win32::AdminMisc, Win32::ODBC, etc.) not available. December 22, 2005, 7:38 am
use Win32::TieRegistry if ($^O =~ /win32/i) June 1, 2006, 12:58 pm
Help with Win32::OLE May 11, 2005, 9:24 am
hel with win32::ole November 7, 2005, 11:07 am
@INC and win32 December 6, 2005, 5:52 am
Win32::GUI or Tk ? November 16, 2006, 7:25 am
Win32::MMF What's going on? February 12, 2008, 6:28 pm
Using Win32::OLE(’in’) May 7, 2008, 10:39 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap