Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: searching parameter names

by reasonablekeith (Deacon)
on Mar 24, 2006 at 12:18 UTC ( [id://539007]=note: print w/replies, xml ) Need Help??


in reply to searching parameter names

You just need to search through all the parameter names looking for the ones which match you condition. If you're using CGI, you can do something like this.
my $q = new CGI; my @hello_param_names = grep {m/hello/} $q->param();
---
my name's not Keith, and I'm not reasonable.

Replies are listed 'Best First'.
Re^2: searching parameter names
by Anonymous Monk on Mar 24, 2006 at 12:29 UTC
    Thank you,

    works great. So to actually retreive the values, I would have to do a little foreach statement and then print the values. Is there a shorter way I can take this concept but instead of storing the names of the paremeters, just store the actual values of all paremeters with the world "hello". That way, I would have one less foreach statement in my code. I'll continue trying to figure it out and if I do, I'll repost it here for future ref.
      You mean like this?
      my @hello_values = map { $q->param($_) } grep {m/hello/} $q->param(); # untested!
      ---
      my name's not Keith, and I'm not reasonable.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-03-28 21:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found