LPM: RE: join

Rich Bowen rbowen at rcbowen.com
Sun Apr 2 20:44:53 CDT 2000


repett0 at sac.uky.edu wrote:
> 
> I think Im seeing the problem.  Perl dosen't do arrays of numbers?? At

Perl does arrays of numbers just fine. Perl is not real picky about the
whole number vs string thing. It's all the same to Perl (in most cases).

> least that is my assumption.  I am trying to do this
> 
> #!/usr/local/bin/perl
> 
> srand( time() ^ ($$ + ($$ << 15)) );

Perl calls srand for you the first time you call rand. This line is not
really necessary. 
 
> for($i=0; $i<10; $i++)

Missing a { here. The body of a for loop is enclosed in { }

>   $foo[$i] = int(rand(10));
> 
> cassius 75: test.pl
> Scalar found where operator expected at test.pl line 6, at end of line
>         (Missing operator before ?)
> syntax error at test.pl line 6, near ")
>     $foo"
> Execution of test.pl aborted due to compilation errors.
> cassius 76:
> 
> Do you see what Im doing.  I want to make an array of random number, then
> take this and pass it in with other information to a c++ program.  I know
> I could have done this all in c++ but I have instructions to do it this
> way...

Hope this helps.

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