Thomas,
The problem comes from the communication between DOS and Perl.
Any parameter with one or more blanks is split in two or more ARGV's.
I've been playing with your perl-script and the following setup works:
EA tools:
command: C:\test.pl
arguments: "file=$f" "package=$p" "diagram=$d" "element=$e"
(I have ".pl" files associated with perl so I can directly invoke a script)
Test.pl just creates a new EAparms-object. The script for EAparms looks like:
package EAparms;
use strict;
use Win32::OLE;
sub new {
my $self = {};
my $parms = {};
foreach my $v (@ARGV) {
# print ">", $v , "<\n";
if ($v =~ /(.*)=(\w.*)/) {
$parms->{$1} = $2;
}
}
# print "file: '", $parms->{file}, "'\n" if (defined ($parms->{file}));
# print "package: '", $parms->{package}, "'\n" if (defined ($parms->{package}));
# print "diagram: '", $parms->{diagram}, "'\n" if (defined ($parms->{diagram}));
# print "element(s): '", $parms->{element}, "'\n" if (defined ($parms->{element}));
$self->{MODEL} = Win32::OLE->new('EA.Repository', \&OleQuit) or die "Oops\n";
$self->{MODEL}->OpenFile($parms->{file}) or die "File not found";
$self->{DIAGRAM} = $self->{MODEL}->GetDiagramByID ($parms->{diagram})
if (defined ($parms->{diagram}));
$self->{PACKAGE} = $self->{MODEL}->GetPackageByID ($parms->{package})
if (defined ($parms->{package}));
my $i = 0;
foreach my $e (split /,/, $parms->{element}) {
$self->{ELEMENT}->[$i++] = $self->{MODEL}->GetElementByID ($e);
}
$self->{ELEMENTS} = $i;
bless $self;
}
#########################################################
# some cleanup for EA
#
sub OleQuit {
my $self = shift;
$self->Exit();
}
1;
If you want the <prevfile>-functionality you could replace test.bat with a test.pl that invokes the wanted perl-file.
HTH,
Oscar
ps
I'm no "Perlie". my last use of Perl was way back in the previous century.