Kamal Ahmed [EMAIL PROTECTED] wrote:
>I am getting an error message:
>"Use of uninitialized value in concatenation (.) or string at ./exploitD.pl
line 2093.
>
>Line 2093:
>print " $class[intRand(45)]";
>
>How can i get rid of this message ?

You are making the incorrect assumption that the function
call intRand(45) will get evaluated inside of double quotes.
This is not the case.

You can do it in two steps:

  my $index = intRand(45);
  print " $class[$index]";

But you might prefer something like this:

  my $index = intRand( scalar @class );
  print " $class[$index]";

This assumes that intRand( N ) returns an integer
in the range 0 .. N-1 .  The value "scalar @class" is the
number of elements of the @class array.

--
Mike Arms


_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to