Click here to get back home

drive externally a tcl interpreter

 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
drive externally a tcl interpreter Filippo 09-26-2006
Posted by Filippo on September 26, 2006, 9:39 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 September 26, 2006, 5: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
Is there any module to map a network drive and remove a mapped network drive in perl October 22, 2007, 8:11 am
4gb USB Flash drive for $14.49 March 25, 2008, 10:10 pm
install, usb flash drive March 13, 2005, 3:17 pm
Read Zip on SMB drive with Perl February 20, 2007, 3:02 pm
how to do operation on a mapped drive October 8, 2007, 7:20 am
install perl on usb flash drive March 14, 2005, 7:10 am
[Q] How to seach an unmapped network drive August 28, 2008, 3:15 pm
FAQ 8.0 What does "bad interpreter" mean? March 8, 2005, 6:03 pm
FAQ 7.29 What does "bad interpreter" mean? April 5, 2005, 5:03 pm
FAQ 7.29 What does "bad interpreter" mean? June 21, 2005, 5:03 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap