Given this code:
> 1.    @array = qw ( hello world hello how are you );
> 2.    $match = 'HEllo';
> 3.    print "Your search for $match returns $subroutine $count
> records<br>\n";
> $subroutine = &count;
> sub count {
>         foreach $record (@array){
>                  if (grep /$match/i, $record) {
>                     print $record;
>                     $count++;
>                 };
>         };
> };


One of us lamented:
> Sigh ! My mind simply refuses to work. What must I do to print the number of
> records $count in line 3.

Put one line of code earlier in the script. You're getting an
"uninitialized variable" msg.  That's because one of the
variables in the print statement is undef. Think about
where it gets its value.

> Thanks

You're welcome. JEC.

P.S.  Read up on the "use strict" pragma for next post.





-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to