Click here to get back home

perl script to pass data to another 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
perl script to pass data to another perl script? PhEaSaNt PLuCKeR 10-30-2005
Get Chitika Premium
Posted by PhEaSaNt PLuCKeR on October 30, 2005, 7:32 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 xhoster on October 30, 2005, 7: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

Similar ThreadsPosted
Pass output from shell script back to perl April 28, 2005, 1:23 pm
Is there a perl package, or data in a form easily used by a perl script, that can be used to determine when to change to or from daylight savings time? November 6, 2008, 5:00 pm
need simple perl script to do secure data transmission July 28, 2004, 4:43 am
PERL Script to Load data into an oracle database August 5, 2006, 6:55 am
How do I detect if I have incoming data in when I pipe somethingto my perl script ? August 5, 2004, 2:45 pm
Script to pass info to GET string November 12, 2004, 8:59 am
what's wrong calling a Perl/CGI script in Perl/CGI script under Tomcat server? April 8, 2007, 11:38 pm
How to pass a range (2 .. 42) by Getopt::Long to a script? March 6, 2008, 6:38 pm
Problem in passing values to perl script using another perl script August 10, 2005, 12:32 pm
Issue in executing more than one perl script from Single perl script November 1, 2007, 2:52 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap