"Merrychristmas!" wrote:
>
> 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++;
> };
> };
> };
my @array = qw ( hello world hello how are you );
my $match = 'HEllo';
my $count = () = "@array" =~ /(\b\Q$match\E\b)/ig;
print "Your search for $match returns $count records<br>\n";
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]