[ic] interchange and external perl packages

Webpraxis Consulting Ltd. interchange-users@icdevgroup.org
Mon Dec 2 21:08:01 2002


At 05:06 PM 12/2/02 -0800, you wrote:
>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

You forgot the underscore after '@': my ($path) = @_;

Cheers,

Yves Beaudoin, Ph.D., President,
Webpraxis Consulting Ltd.,
Edmonton, Alberta, Canada, T5R 5S5
E-mail: post@webpraxis.ab.ca

Owner of the Virtual Railroad:
www.webpraxis.ab.ca/vrr/