[ic] Catalog subroutines

Caleb Groom interchange-users@icdevgroup.org
Thu May 1 15:51:01 2003


> >
> > Sub <<EOF
> > sub show_custom_cart {
> >  my $out = sprintf("%d item%s", scalar @{$Carts->{main}}, scalar
> > @{$Carts->{main}} == 1 ? "" : "s");
> >  return $out;
> > }
> > EOF
>
> Does that compile without error ?

Yep, that's valid code.

> > Your cart: [perl] return show_custom_cart(); [/perl]
>
> Please try [perl subs=1] return show_custom_cart(); [/perl]
>

Works like a champ.  That's section "61.52.2.4. subs" of the documentation.
Thank you for the help.