Click here to get back home

Version? Getopt::Long

 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
Version? Getopt::Long Mark J Fenbers 10-04-2004
Posted by Mark J Fenbers on October 4, 2004, 3:00 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 October 4, 2004, 7:20 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 Johan Vromans on October 7, 2004, 3:26 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
beginner trying to use Getopt::Long October 12, 2006, 2:58 pm
Getopt::Long install problems October 4, 2004, 6:33 pm
Option Values with Spaces using GetOpt::Long October 10, 2006, 2:30 am
How to pass a range (2 .. 42) by Getopt::Long to a script? March 6, 2008, 6:38 pm
Getopt::Long (how to make it die after saying "option requires an argument"?) June 13, 2005, 11:05 am
Parsing function args in Getopt::Long style January 11, 2008, 4:11 pm
Having problems parsing command line options using Getopt::Long on windows December 2, 2004, 8:48 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
Higher-Order Perl: The Quest for an Accessible Version, Initial Impressions (Long) April 1, 2006, 7:12 pm
'long long integer' in Perl February 15, 2006, 2:30 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap