Click here to get back home

connect to a database when using a proxy (to access the internet)

 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
connect to a database when using a proxy (to access the internet) ver_for 08-31-2005
Posted by ver_for on August 31, 2005, 9:14 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 Paul Lalli on August 31, 2005, 9:35 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
Server-Clienrt Connect over Internet December 15, 2006, 12:01 pm
connect a database in remote server (can connect to the server via SSH) July 17, 2007, 12:35 pm
database connect: protect with exceptions? September 18, 2006, 4:25 pm
trying to connect to a mysql database, to input a file January 8, 2005, 2:57 pm
Using the DBI to connect to an Oracle server w/o connecting to a database December 12, 2007, 5:00 pm
Installing a BUNCH of modules but no Internet access! January 19, 2006, 4:58 pm
PostgreSQL database access May 29, 2007, 8:37 am
Speed comparisons - LWP and database access January 24, 2007, 8:14 am
How to read access database file with perl? November 16, 2004, 12:50 am
(the simplest question of the century ?) Simple access to ... ACCESS! April 12, 2005, 7:58 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap