Using OpenDoc6 in Perl

Does anybody have experience programming in Perl? I amupdating a current Perl script that generates PDF's of drawings inour PLM system, but is causing me some problems right now. Thescript uses OpenDoc2 which doesnt seem to give the option ofopening files Silent, or AutoMissingConfig. In any case, errorboxes are popping up, so I have to monitor this script all thetime.

My problem in using OpenDoc6 is that SW wants &errors and&warnings variables passed in as Long data type. Perl'sstandard scalar variables support almost everything but the Longdata type. I have tried using Win32:LE::Variant as well, with no success.

Any help or guidance would be great!

(using SW2007 btw)

Current code is shown below.

\$workdir = "D:\\solidworks";
\$filename = "test.SLDDRW";

\$sld = new Win32:LE ("SldWorks.Application", 'Quit');
if (\$debug) {
\$sld->{Visible} = 1;
} else {
\$sld->{Visible} = 0;
}

\$sld->SetCurrentWorkingDirectory (\$workdir);

# This line works...
\$doc = \$sld->Opendoc2 ("\$workdir\\\$filename", 3, "TRUE","FALSE", "TRUE", \$errors);

#This line doesn't work...
\$doc = \$sld->OpenDoc6("\$workdir\\\$filename",3,1,"",\$errors,\$warnings);
SolidworksApi macros