LPM: RE: join

repett0 at sac.uky.edu repett0 at sac.uky.edu
Sun Apr 2 20:55:16 CDT 2000


thanks, now I see the problem (I think :)) you need to use brackets.  I
assumed that you get one line for free like c/c++ or java.  One more ?,
how do you get the length.  Im doing it like this now...

#!/usr/local/bin/perl

for($i = 0; $i < 10; $i++)
{    $foo[$i] = int(rand(10));print "$foo[$i]\n";}


Thanks,...

Ron


On Sun, 2 Apr 2000, Rich Bowen wrote:

> repett0 at sac.uky.edu wrote:
> >
> ...
> > for($i=0; $i<10; $i++)
> >   $foo[$i] = int(rand(10));
>
> By the way, I couldn't resist. A more "Perlish" way to do this would be:
>
> $foo[$_] = int(rand(10)) for (1..10);
>
> :-)
>
> Rich
> --
> http://www.ApacheUnleashed.com/
> Lexington Perl Mongers - http://lexington.pm.org/
> PGP Key - http://www.rcbowen.com/pgp.txt
>




More information about the Lexington-pm mailing list