NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
You overengineered it (Score:1)
Because it's actually as simple as:
"%~dp0perl.exe" -x -S "%~f0" %*
The quotations and "%~f0" are needed in case batch file is in a directory with whitespaces.
I'm afraid it is not quite that simple (Score:2)
You can find my earlier attempt here: http://groups.google.com/group/perl.perl5.porters/msg/b1880b658b5ab73f [google.com]
It worked for all the test cases
WSH (Score:1)
Batch certainly sucks, it even has two(!) incomplete sets of escaping rules.
So instead of that complete and utter mess, why not use Windows Scripting Host [wikipedia.org]? That sounds a lot easier.
Re: (Score:1)
A very long ago, when I needed to automate things and didn't know .net/perl/python I was using WSH (via its javascript), and I must say it sucks even more. Especially since windowed/console mode is a global setting, plus it had some funny glitches in child processes execution. So, batch files are much better.