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

I've a set of Visual basic scripts which I invoke from MS-DOS prompt as : wscript <path to the VB script> Now my attempt to invoke a wrapper kind of perl script running on windows(I've installed ActivePerl) to invoke these VB scripts sequentially seem to be not working. <trivial code snip from wrap.pl>
use strict; use warnings; system("C:\\Windows\\System32\\Wscript.exe c:\\blahblah.wsf");
<trivial code snip from wrap.pl>

C:\Perl\bin>perl -c C:\wrap.pl

C:\wrap.pl syntax OK

Though invoking wrap.pl doesn't throw me any error, but the VB script (in this case blahblah.wsf) is somehow not getting invoked. Please let me know how to resolve this.

Replies are listed 'Best First'.
Re: perl and wscript
by Anonymous Monk on Feb 07, 2011 at 10:26 UTC
    is somehow not getting invoked.

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

    use autodie qw' system ';

      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 :)