Click here to get back home

Where is EOM defined?

 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
Where is EOM defined? mailbox 08-16-2005
Posted by mailbox on August 16, 2005, 1:01 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 Paul Lalli on August 16, 2005, 1:15 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
short form for (defined $x and defined $y and ... )? March 25, 2006, 12:14 am
Where are Inline_Stack_Vars, etc. defined? July 30, 2005, 7:36 am
not defined v. eq undef January 25, 2008, 4:19 am
Where was a function defined? September 2, 2006, 6:39 pm
Shortcut for if(defined($var) && $var ne "") ? April 6, 2008, 2:53 am
How can I find out where a subroutine is defined? September 29, 2004, 8:48 pm
SysV constants, where are they defined? November 17, 2004, 10:16 am
Question on "defined" function February 22, 2006, 10:38 am
Example for User-defined subroutines for GetOptions please June 24, 2005, 9:51 pm
how can I access an array defined in another module January 2, 2007, 4:41 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap