ANNOUNCE: Inline::WSC V0.01

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

Inline::WSC allows Perl to call JavaScript and VBScript methods,
passing parameters and retrieving return values.

Inline::WSC is Win32-only.

Inline::WSC is available for download on CPAN now.


use Inline::WSC VBScript => <<'EOF';

  Function Hello( ByVal Name )
    Hello = "Hello there, " & Name & "!"
  End Function


print Hello( "Fred" );
# Hello there, Fred!


Re: ANNOUNCE: Inline::WSC V0.01

Quoted text here. Click to load it

I've never messed with VBScript before, though now that you've provided an
Inline of it, I might just meddle with it from time to time :-)

One problem is that 'C:\windows\temp' is not guaranteed to exist, or be
writable by the user. (It doesn't exist on my Windows 2000 box - and my
initial 'nmake test' failed because of that reason - $ofh did not get
opened.) If you want to write the '.wsc' file to a temporary folder then I
think the best way is to:

use File::Spec;
my $WSC_DIR = File::Spec->tmpdir;

And I think you should still test the opening of $ofh for success (and die
if it failed):
open my $ofh, '>', $filename or die "Can't open $filename for writing: $!";

With the only other Inline modules that I've used (namely Inline::C and
Inline::CPP), the files that get created by the build process are built in
the ./_Inline directory. My first thought was that the '.wsc' file should
also be written in the ./_Inline directory instead of File::Spec->tmpdir. I
don't know that there's any hard and fast rule about this, however, and if
you were to do it that way then obviously you have to give the module the
capability of creating ./_Inline if that folder doesn't already exist.

I notice that you've started the Makefile.PL with:
use 5.008006;

That's probably a bit limiting, isn't it ? I would think that 'use 5.008;'
would be more in order .... or perhaps even 'use 5.006;' ??


Re: ANNOUNCE: Inline::WSC V0.01

Thanks for the feedback -

Good idea about the tempdir - I'll apply a patch and re-release.

Site Timeline