[ic] interchange and external perl packages

David McGuire interchange-users@icdevgroup.org
Mon Dec 2 20:07:00 2002


I'm trying to build a UserTag that has to use an external library.  I'm not
all that familiar with interchange as of yet being that I just got moved
into this project, but here's what I've written so far:

UserTag thumb Order path
UserTag thumb PosNumber 1
UserTag thumb Routine <<EOR
eval {
    require Image::Magick;
};
if($@) {
        return sub {
            ::logError("Cannot generate thumbnail, Image::Magick module not
installed: $@");
        };
}
use Image::Magick;
sub {
       my ($path) = @ ;
       my $srcImage = Image::Magick->new;
       my $x = $srcImage->Read($path);
       $x = $srcImage->Resize(geometry=>'100x100');
       $x = $srcImage->Write($path);
       return;
}
EOR

the "use Image::Magick;" part is something I was just trying recently

however when I try to start the server it gives me this error:


UserTag 'thumb' subroutine failed compilation:

        Global symbol "$srcImage" requires explicit package name at (eval
99) line 12, <GLOBAL> chunk 426.
 syntax error at (eval 99) line 12, near "@ ;
       my "

In line 426 of the configuration file 'interchange.cfg':
UserTag thumb Routine <<EOR


I'd appreciate any advice one could give me with this

David McGuire