Click here to get back home

return value

 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
return value Feyruz 10-07-2005
Posted by Feyruz on October 7, 2005, 3:57 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 A. Sinan Unur on October 7, 2005, 11:18 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
windows program return values vs perl return values from a call to system() -- windows post only October 29, 2005, 6:22 pm
why is return always 0? March 16, 2008, 8:45 pm
Help with 'system' seeming to return too soon... September 13, 2004, 2:08 pm
FAQ: How come exec() doesn't return? October 9, 2004, 5:10 pm
FAQ 8.2 How come exec() doesn't return? March 11, 2005, 12:03 am
=~ return value ? boolean ? May 17, 2005, 3:29 am
FAQ 8.2 How come exec() doesn't return? May 31, 2005, 11:03 pm
return and undef October 4, 2005, 8:35 am
FAQ 8.2 How come exec() doesn't return? October 8, 2005, 4:03 am
strange return value October 18, 2005, 1:14 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap