Click here to get back home

How to create a folder in ftp using 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
How to create a folder in ftp using perl windqin 08-08-2006
Get Chitika Premium
Posted by windqin on August 8, 2006, 12:49 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 Simon Taylor on August 8, 2006, 1:21 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 windqin on August 8, 2006, 3:03 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
Create a chinese directory (folder) by Perl in Windows 2000 English OS September 21, 2004, 4:51 pm
write to windows share folder from perl/Win32 October 25, 2005, 4:48 pm
perl to move mail from inbox to a personal folder August 4, 2006, 1:03 am
PERL ---> Move email from Inbox folder to another or vice versa in OUTLOOK August 4, 2006, 10:39 pm
perl in Windows: using the "Send To" folder and perl September 23, 2004, 4:47 am
Copying a folder November 20, 2004, 9:46 pm
simple folder search November 18, 2004, 8:28 pm
How to replace the "\" in "C:\myrootr\folder" with "/" ? June 26, 2007, 1:38 pm
Are there alternatives to Mail::Box and Email::Folder? September 7, 2004, 3:41 pm
Creating a WIN32 folder share August 24, 2005, 3:47 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap