Rob Dixon wrote: > > #perl > use strict; > use warnings; > > my @target = map { s/\s.*//s; $_ } <DATA>; > close DATA; > > my $candidate = ':B000:W000:M260:8:'; > > foreach my $soundex ($candidate =~ m/\w+/g) { > > printf "%4s -", $soundex; > > foreach (@target) { > my $count = @{[m/\b$soundex\b/g]};
No need to create and then dereference an anonymous array, you can get list context for the count like this: my $count = () = /\b$soundex\b/g; John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]