Click here to get back home

DBD/DBI failing to add a blank in a non-null field

 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
DBD/DBI failing to add a blank in a non-null field dn_perl@hotmail.com 12-29-2004
Get Chitika Premium
Posted by dn_perl@hotmail.com on December 29, 2004, 5:49 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 Matt Garrish on December 29, 2004, 9:37 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
pp failing September 20, 2004, 8:26 pm
Why is this dup failing under BSD? December 30, 2006, 1:05 pm
perlcc failing December 15, 2007, 7:21 am
Bitwise comparison failing July 9, 2004, 7:51 pm
Failing File Tests? August 5, 2004, 5:11 pm
mysql connection failing as CGI November 21, 2006, 1:03 pm
Build of Perl 5.8.8 is failing December 27, 2006, 6:55 pm
Tk Compilation on Solaris 10 Failing December 4, 2007, 3:53 am
file upload failing for some users June 23, 2005, 10:17 am
failing to apply eval to a string January 9, 2006, 11:10 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap