On Tue, Oct 05, 2004 at 02:25:08PM -0700, James Taylor wrote:

> Here's a better example of something that actually might serve a bit 
> more purpose along with the error I'm getting for THIS
> particular example.
> 
> sub genrand {
>   my [EMAIL PROTECTED]; my $r;

I'm not sure that this will solve everything, but you likely want

    my ($l) = @_;

>   my @chars=('a'..'z','A'..'Z','0'..'9','_');
>   $r.=$chars[rand @chars] for(1..$l);
>   return $r;
> }

> So, what I can gather is that the value '20' isn't being received by the 
> genrand subroutine, and it's getting something else instead.  What 
> exactly, I'm not sure

I would have expected $l to be set to 1, the number of elements in @_.

-- 
Paul Johnson - [EMAIL PROTECTED]
http://www.pjcj.net

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to