> Sigh ! My mind simply refuses to work. What must I do to print the number
of
> records $count in line 3.
> Thanks
>
>
> 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++;
>                 };
>         };
    ### add this:
    return $count;

> };
>
>

you simply 'return' what you want to return ;)
try 'perldoc -f return'

hth, Jos



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

Reply via email to