Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Coding problem

by mkmcconn (Chaplain)
on Aug 07, 2002 at 17:03 UTC ( [id://188388]=note: print w/replies, xml ) Need Help??


in reply to Coding problem

I am not sure that it's useful to perform the intermediate step of substitution. This ought to work:

my @searchWords = split(/\s+/, $Input{'query'}); foreach my $active(@active){ my $newd = lc($active); foreach my $searchWord(@searchWords){ $searchWord = lc($searchWord); push(@found, "$active: matches '$searchWord'") if grep { /$se +archWord/ } $newd; } } __END__ prints "active: matches searchWord"

update Because this is not supposed to be doing anything different than your sample, I suspect that your sub is not really returning an array: my guess.
mkmcconn

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://188388]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (3)
As of 2024-04-26 04:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found