Click here to get back home

redirect incoming data to port 21 with perl

 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
redirect incoming data to port 21 with perl saeed 09-05-2004
Get Chitika Premium
Posted by saeed on September 5, 2004, 11:16 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 Joe Smith on September 7, 2004, 12: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
How do I detect if I have incoming data in when I pipe somethingto my perl script ? August 5, 2004, 2:45 pm
uncleared data on serial port problem July 18, 2007, 10:34 am
Windows XP problem, how to print some data to printer connected on LPT port? March 8, 2007, 10:12 am
Socket Send and Receive, Same local port, Different Remote Port March 1, 2005, 12:35 pm
Serial Port programming - Reading DSR from port July 11, 2005, 2:29 pm
Changing remote_addr on incoming request September 14, 2005, 2:04 pm
OS/2 port of Perl 5.8 not adding CR to \n August 29, 2004, 2:06 pm
perl port to my m68k calculator December 7, 2004, 4:01 pm
Serail Port communication using PERL May 4, 2006, 2:59 am
perl script to interact with PC port April 23, 2008, 10:13 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap