Re: OO Perl, iterators



Tad McClellan <tadmc@xxxxxxxxxxxxxx> wrote in comp.lang.perl.misc:
> Anno Siegel <anno4000@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
>
> >> - how to access the i'th answer; $query->answer[$i] does not work
> >
> > my $i_th = @answers[ $i];
> ^
> ^
>
> my $i_th = $answers[ $i];
>
>
> >> - how to access a random answer
> >
> > my $rand_ans = @answers[ rand @answers];
> ^
> ^
>
> my $rand_ans = $answers[ rand @answers];

Oh dear, yes!

Anno
--
If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers.
.



Relevant Pages