[ic] IC/eBay API integration -> impending donation

Grant listbox at email.com
Wed Sep 17 15:39:43 EDT 2003

> > > You have a variable scope problem. You're declaring a lexical "$tag"
> > > variable inside the main sub, which can't be seen from the
> sub whatever.
> > > You need to either declare it so it's visible from both subs,
> or pass the
> > > value from one to the other.
> >
> > What can I add to the code to declare $tag so it's visible from
> all subs?
> You can just declare it before either of the subs. Watch out that the name
> doesn't conflict with other usertags, though, since they run in the same
> package Vend::Interpolate as others, IIRC. I'd use something like
> $parsexml_tag.
> Jon

Ok, I moved the:

my $tag="";

above all the subs and the $tag error went away at restart.  I get a
"UserTag 'parsexml' code is not a subroutine reference" error at restart now
though.  Removing the following lines of code from one of the UserTag's subs
gets rid of that error, and IC restarts without any errors at all:

push @field,$tag;$tag="";

Is there anything wrong with that code?

- Grant

More information about the interchange-users mailing list