Click here to get back home

connect a database in remote server (can connect to the server via SSH)

 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 a database in remote server (can connect to the server via SSH) zhangxiaoyu912 07-17-2007
Posted by zhangxiaoyu912 on July 17, 2007, 12:35 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 Jens Thoms Toerring on July 17, 2007, 1: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 usenet on July 18, 2007, 3: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

Similar ThreadsPosted
Net::SSH::Perl to connect to a remote server via a web page August 30, 2004, 10:07 am
Using the DBI to connect to an Oracle server w/o connecting to a database December 12, 2007, 5:00 pm
Server-Clienrt Connect over Internet December 15, 2006, 12:01 pm
Choosing the correct mysql server to connect to April 16, 2007, 8:08 am
Unable to connect to remote host March 31, 2005, 8:22 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
connect to a database when using a proxy (to access the internet) August 31, 2005, 9:14 am
i need to ssh to remote server using Perl September 11, 2006, 9:25 am
DBI::ODBC Remote Login to Server September 23, 2004, 8: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