[ic] random number

Grant interchange-users@icdevgroup.org
Sun Nov 24 19:57:00 2002


>Grant [listbox@email.com] wrote:
>> 
>> I'm trying to generate a random integer between 0 and 250 and 
>the following
>> doesn't return anything:
>> 
>> [perl]
>>         $Scratch->{random_number} = int rand(250)
>>         undef;
>> [/perl]
>> 
>> [scratch random_number]
>> 
>> Can someone tell me what I'm doing wrong?
>> 
>The main thing is that you don't appear to be reading your error.log
>file(s).
>
>If your log states "Safe: syntax error..." then you could try
>terminating the appropriate lines of your Perl code with a ';'.
>
>If your log states "Safe: rand trapped by operation mask..." then
>you could try adding 'rand' to the SafeUntrap directive's list, in
>your interchange.cfg file.
>
>If there's another problem with that code (which I doubt) then its
>cause is likely to have been reported in your error.log(s).

Thanks a lot Kevin.  You're right on with the ";" character at the end.

- Grant