Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Coding problem

by mkmcconn (Chaplain)
on Aug 07, 2002 at 17:03 UTC ( #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? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2023-01-28 06:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?