On 9/3/05, Rick Nakroshis <[EMAIL PROTECTED]> wrote:

> To be more precise, no, there is no translator that analyzes what
> your batch file is doing to then generate a perl script.  If you show
> us your batch file, we can give you some pointers and ideas if you like.
> 
> Rick

I can't think of a standard DOS 5 utility that has functionality not
available from within Perl, so the tool would certainly be possible.

It would look something like this:

#!perl

use BatchInPerlLibraryModuleThatHasNotBeenWrittenYet;
while(<>){
       my($command, $args) = /(\w+)\s+?(.*)/ or next;
       $command = lc $command;
       $command eq 'rem' and next;
       isBATCH($command) and do{
              BatchInPerlLibraryModuleThatHasNotBeenWrittenYet->$command($args);
              next;
       };

       system($_);  # fall back to looking the FS anyway

};

__END__

If you were to write this module you would be a hero to anyone who needs
to port batch files to non-MSDOS systems.  You could write the parts of it
that are needed to support the scripts you need to port, then ask for a TPF
grant to write the rest of it.

Sort of like TChrist's project to rewrite all the unix command line
tools in Perl.

MSDOS is a unix, you know -- I have a MSDOS 2.0 manual, and it talks about
MSDOS as being a weak version of unix, when introducing the piping and
redirection
operators.

_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to