Click here to get back home

"Undefined subroutine"

 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
"Undefined subroutine" B H 11-21-2004
Get Chitika Premium
Posted by B H on November 21, 2004, 8: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

Posted by Jim Keenan on November 21, 2004, 7:59 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
Undefined subroutine CGI::Vars July 26, 2004, 3:05 pm
Undefined subroutine &main January 19, 2007, 7:21 am
"Undefined subroutine &main:: called." from nowhere?? August 11, 2004, 2:45 pm
Mystery message: Undefined subroutine &OS2::Bootdrive September 22, 2004, 5:12 pm
Error "Undefined subroutine" & module references August 10, 2005, 9:23 am
Undefined subroutine even though it appears in symbol table? January 27, 2007, 10:58 am
FAQ 4.67: Why does passing a subroutine an undefined element in a hash create it? December 13, 2004, 6:03 pm
FAQ 4.67 Why does passing a subroutine an undefined element in a hash create it? May 11, 2005, 11:03 am
FAQ 4.67 Why does passing a subroutine an undefined element in a hash create it? February 1, 2005, 12:03 pm
FAQ 4.67 Why does passing a subroutine an undefined element in a hash create it? July 27, 2005, 4: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