Click here to get back home

system calls (mv + grep) within Perl script

 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
system calls (mv + grep) within Perl script William 01-06-2006
Get Chitika Premium
Posted by William on January 6, 2006, 3:19 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
Perl System Calls May 13, 2005, 10:33 am
No execution of system calls in cygwin-perl after update August 24, 2006, 4:22 pm
problem running grep within system command in perl March 19, 2006, 12:53 pm
System calls question May 5, 2005, 7:18 pm
sleep between system calls October 31, 2005, 7:09 am
feedback from system() etc. calls? September 8, 2008, 5:27 am
calling External Perl Script Who calls another December 13, 2005, 12:34 pm
system() calls in windows not working for some users January 24, 2006, 2:22 pm
multiple system calls running at the same time June 21, 2006, 5:13 pm
RPC::XML::Server make_method .xpl files - Not able to make system calls August 10, 2006, 3:30 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap