Click here to get back home

Cloning structures containing weak references

 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
Cloning structures containing weak references Mintcake 03-03-2005
Get Chitika Premium
Posted by Mintcake on March 3, 2005, 4:15 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 Tom Regner on March 3, 2005, 4:09 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
What is weak references? March 12, 2008, 11:17 am
Weak references are not implemented in the version of perl at /tmp/replacebinary/Getopt/LL/DLList/Node.pm line 11 November 3, 2007, 11:30 pm
Cloning classes, deep copy revisited (Was: Copy Consturctor in Perl) .. November 23, 2008, 3:33 pm
Data Structures in PERL September 3, 2004, 5:28 am
Which data structures to use? (Hash.. etc.,) October 31, 2004, 2:54 am
having trouble with control structures December 10, 2004, 10:07 pm
Massive Memory Structures June 13, 2007, 4:44 pm
Re: Massive Memory Structures June 15, 2007, 2:55 pm
Objects/Structures in Perl July 26, 2007, 5:00 pm
question about data structures - what does $# mean? August 30, 2008, 8:21 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap