in reply to perl and wscript

is somehow not getting invoked.

Because you're checking for syntax (-C)?

use autodie qw' system ';

Replies are listed 'Best First'.
Re^2: perl and wscript
by rango (Initiate) on Feb 07, 2011 at 10:40 UTC
    The syntax check was to make sure that there are no errors pertaining to syntax in the sample script. I did invoked the script with the simple calling convention, viz.

    C:\Perl\bin\perl <my_perl_script>

    But It seems that somehow perl and wscript are not communicating well with each other.

      But It seems that somehow perl and wscript are not communicating well with each other.

      Why/how are you expecting them to communicate? system is not used for communication

      $ perl -e " system qw[ cscript //?]" CScript Error: Windows Script Host access is disabled on this machine. + Contact your administrator for details.
      wscript uses a popup dialog with same message :)
        with autodie
        $ perl -Mautodie=system -e " system qw[ wscript //? ]" "wscript" unexpectedly returned exit value 1 at (eval 10) line 13 at -e line 1 $ perl -Mautodie=system -e " system qw[ cscript //? ]" CScript Error: Windows Script Host access is disabled on this machine. + Contact your administrator for details. "cscript" unexpectedly returned exit value 1 at (eval 10) line 13 at -e line 1
        As the VB scripts can be invoked using cscript/wscript <name_of_your_VB_script>, Hence my assumption is to be able to invoke cscript/wscript in the same fashion by using Perl's system function.

        This time i tried with cscript by invoking

        cscript //h:cscript

        Now Getting error.

        C:\Perl\bin>perl -e "system qw[ cscript c:\\blahblah.wsf]"

        Microsoft (R) Windows Script Host Version 5.7 Copyright (C) Microsoft Corporation. All rights reserved.

        [IGN-]2011-02-07 03:19:47[-IGN][FAIL] StartScript: Unable to create controller object - 1A8 <----