MiniVend Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

Re: [mv] Trouble getting piece of perl script working HELP!







On Mon, 27 Sep 1999, Jarno Niemela wrote:

> ******    message to minivend-users from Jarno Niemela <jargon@iki.fi>     ******
> So it seems that it didn't like the 
> 
> >> if ($i < 0 or $i > 20)
> >> {
> >>     exit;
> >> }

Did you try replacing 'exit' with 'return'?  Exit usually stops the
executable completely but within a Safe environment may do something
different.

Return should just return to the calling routine or exit the subroutine.
Note that 'return;' and 'return "";' are not the same.  The first returns
an undefined value in both scalar and array contexts.  The second returns
an empty string.

> But however, when I try to make it to work as user tag in catalog.cfg
> The minivend comes up with the tag reference in the resulting page
> (does this mean that it doesn't recognize the new tag)

How are you calling it?

This should work:

checksum: [calc-checksum bank_ref=[value bank_ref]] <BR>


> I use following code in creating the tag.
> 
> UserTag calc-checksum ORDER bank_ref
> UserTag calc-checksum Routine <<EOR
> sub {   
> my ($receipt_nr)=@_;      
> 
> my @multipliers = (7,3,1);
> 
> if ($receipt_nr =~ /([0-9]*)/)
> {
>     $receipt_nr = $1;
> }

I assume that there are a few more lines of code after this?  At least an
EOR?

Best,
Kyle





Search for: Match: Format: Sort by: