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

Re: grep not working as expected

by chargrill (Parson)
on Oct 17, 2006 at 22:31 UTC ( #578917=note: print w/ replies, xml ) Need Help??


in reply to grep not working as expected

Does it still not work if you do the following:

my $param = $q->param('report_type'); print "param=" . $param . "<BR>"; if( grep { /$param/ } (qw/case_id hosp_alias sender receiver/) ) { print "we are getting the list<BR>"; } else { print "we are NOT getting the list<BR>"; }

If it still doesn't work, then something is wrong somewhere else. If this does work, then perhaps the answer is tied to Fletch's response to the post just before yours, Re: Strange behaviour of m and $_ - in that (quoting Fletch) "Subroutine invoations don't interpolate in double quoted strings (of which m// is a special kind.)"



--chargrill
s**lil*; $*=join'',sort split q**; s;.*;grr; &&s+(.(.)).+$2$1+; $; = qq-$_-;s,.*,ahc,;$,.=chop for split q,,,reverse;print for($,,$;,$*,$/)


Comment on Re: grep not working as expected
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (12)
As of 2014-10-31 09:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (216 votes), past polls