Click here to get back home

-d file test using Active State PERL under Windows

 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
-d file test using Active State PERL under Windows Scott 10-07-2004
Posted by Scott on October 7, 2004, 10:58 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
Active State perl for windows not working. January 8, 2008, 3:34 pm
Active State Perl July 26, 2005, 7:41 pm
Active State Perl PPM version 4.00 issues November 22, 2006, 2:13 pm
Active State Perl with Unix-line endings -- Help October 16, 2004, 10:04 am
IIS Like Error using Perl Active State w/ SQL Server or MySQL April 28, 2006, 2:12 pm
Active State July 8, 2004, 10:51 am
PERL can't open file for logging (world writable directory Windows XP Home/ Active Perl / Apache) November 8, 2006, 5:50 pm
-d file test operator not working (windows) July 21, 2005, 8:48 am
Problem with Win32-SerialPort over bluetooth @ windows + active perl July 21, 2006, 4:08 am
How to detect active folder in Windows XP? January 30, 2007, 4:35 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap