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

Can anyone tell me, please, how to use a VB class from within perl ASP code. Specifically, I'm trying to make use of the Free ASP Upload class (www.freeaspupload.net) from within an ActiveState ASP Perlscript. So I'm trying to code the equivalent of these lines:
Dim Upload Set Upload = New FreeASPUpload Upload.Save("D:\web\temp")
TIA

Replies are listed 'Best First'.
Re: Using VB classes
by Corion (Patriarch) on May 07, 2004 at 08:44 UTC

    Most likely, the straight translation to Win32::OLE will do the trick:

    use strict; use Win32::OLE; my $Upload = Win32::OLE->new( 'FreeASPUpload' ); die "Couldn't create upload class FreeASPUpload : $^E" unless $Upload; $Upload->Save('D:/Web/temp');

    Possibly, you're better off by using some Perl modules like CGI::Upload or simply CGI.pm, depending on your exact needs to upload files.

      I thought it would too, but sadly it doesn't seem to work, returning an empty error string. I think the reason is that the object class definition is included in the ASP script and not registered as with most OLE objects. Perhaps I'm barking up the wrong tree by trying to mix VB and perlscript in the same source file.