Click here to get back home

executing a bat file from a web page

 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
executing a bat file from a web page abhatia83 04-21-2006
Posted by abhatia83 on April 21, 2006, 10:13 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 Si Ballenger on April 22, 2006, 2:04 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
Can I iterate through a file on a CGI page? April 1, 2008, 9:05 pm
File statistics from web page files December 19, 2004, 3:41 pm
LWP user agent grabs the intermediate wait page after POST intead of the actual result page February 12, 2008, 12:50 am
How to upload a file from a local pc to a web server from a html page???? August 18, 2004, 6:40 pm
transfer value from one page to single frame of a second,frameset page September 14, 2008, 7:25 am
SSI executing Perl September 14, 2004, 4:56 pm
Executing cmd from perl script September 8, 2004, 9:49 pm
cgi scripts stops executing? January 20, 2005, 12:56 pm
threads not executing @ same time September 28, 2006, 2:13 am
Executing awk from perl script March 24, 2007, 12:55 pm

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap