himank has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re: Perl migration script
by moritz (Cardinal) on Dec 12, 2007 at 12:29 UTC
    The question is way too vague to be answered in general.

    Perl tends to fit very well for such tasks, but there is no generic "data migration script" that magically does everything you want (unless somebody writes a libjustdoit wrapper for perl).

    Update: in the CB I learned that the OP is looking for a Batch to Perl converter. I don't know of any automated tool that does it, but perhaps somebody else can help...

Re: Perl migration script
by marto (Cardinal) on Dec 12, 2007 at 12:34 UTC
    Hi himank,

    I am not sure exactly what you mean. Are you looking to execute these batch files from within a Perl script, or replace these batch files with a Perl script that does the same thing? I think that you are going to have to be a little more specific. Have a look at How do I post a question effectively? and PerlMonks FAQ.

    Thanks

    Martin
      Well, I need to execute the batch files from within a Perl script Thanks himank
Re: Perl migration script
by talexb (Chancellor) on Dec 12, 2007 at 15:02 UTC
      I need to write a migration script in Perl that can automate these batch files.

    There's some syntactic confusion in your request. You're either asking for a program that will translate a batch file (presumably from DOS/Windows) into a Perl script, or you're asking how to re-write the batch files into Perl. The former seems like a pretty large assignment, so the latter seems like a more normal request.

      Can someone assist me in this plz???

    We can certainly assist you when you get stuck, but that means you have to get started on your task, get stuck, and then come back and post again. Do you have any of the excellent Perl books available from O'Reilly? What level programmer are you? Do you think you'd be able to write this yourself, or will you need to hire someone? (If that's the case, this is not the right site to advertise.)

    ps You can drop the l33t speak -- we speak English here.

    Alex / talexb / Toronto

    "Groklaw is the open-source mentality applied to legal research" ~ Linus Torvalds

      Well, I am sorry for any confusions. I want to call couple of batch files in my Perl script. How do I do that on Windows??
        Hi himank,

        I want to call couple of batch files in my Perl script

        You can do that with system():
        system "my_first.bat"; system "my_second.bat";
        See perldoc -f system .

        Cheers,

        Rob
Re: Perl migration script
by tcf03 (Deacon) on Dec 12, 2007 at 12:44 UTC
    If all you want to do is run batch files, something like this should work. <opinion>Though, I think a better approach would be to replace the batch commands with perl.</opinion>

    use strict; use warnings; my $batchfile = qq|batchfile.bat|; my $status = ( system("batchfile.bat") == 0 ) ? 0 : 1; print "$batchfile status = $status\n";

    update

    Fixed typos

    Ted
    --
    "That which we persist in doing becomes easier, not that the task itself has become easier, but that our ability to perform it has improved."
      --Ralph Waldo Emerson