[ic] Bug in $Tag->subtotal when items discounted?

Jon Jensen jon at endpoint.com
Wed Nov 3 18:34:42 EST 2004


On Wed, 3 Nov 2004, Thomas J.M. Burton wrote:

> Adding AllowGlobal for the catalog, then using global=1 in my perl tag 
> actually ended up causing the perl code to return nothing and, while 
> eliminating the original error, gave me this instead:
> 
> 172.17.1.20 sUbLRNeD:172.17.1.20 - [03/November/2004:14:54:29 -0800] 
> beads /cgi-bin/beads/gccode Safe: Bareword "main" not allowed while 
> "strict subs" in use at (eval 969) line 2.
>  >
>  >
>  >   my $stotal = $Tag->subtotal( { name => main, noformat => 0, } );
>  >   return $stotal;

The error message means exactly what it says: you're trying to use a 
bareword in your Perl code, which isn't allowed with strict on. Try 
instead:

my $stotal = $Tag->subtotal( { name => 'main', noformat => 0, } );

While you're at it, there are some other barewords in your code:

>    my $gctot = $Tag->scratch(gc_total);

Try instead:

my $gctot = $Tag->scratch('gc_total');

Although that should really be:

my $gctot = $Scratch->{gc_total};

>    my $shipmode = $Tag->value(  { name => mv_shipmode, }  );

Try:

my $shipmode = $Tag->value( { name => 'mv_shipmode', } );

And that should really be:

my $shipmode = $Values->{mv_shipmode};

Jon


-- 
Jon Jensen
End Point Corporation
http://www.endpoint.com/
Software development with Interchange, Perl, PostgreSQL, Apache, Linux, ...


More information about the interchange-users mailing list