Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Populating an array reference in a hash with with a regex

by mephit (Scribe)
on Oct 01, 2002 at 16:32 UTC ( [id://202045]=note: print w/replies, xml ) Need Help??


in reply to Populating an array reference in a hash with with a regex

I had completely forgotten that the param method worked like that, and I now agree that's what you should use in this instance. In the future, if you have something similar that isn't CGI, or if you're masochistic enough to try to roll your own, this would work:
my $session = q{1678f192860fb3850d27244c76b704b1&action=select&salesma +n=015&salesman=020&salesman=030&salesman=035&salesman=045&salesman=05 +0&salesman=065&salesman=075&salesman=090&salesman=095&salesman=100&sa +lesman=105&salesman=110&salesman=120&salesman=900&salesman=911&salesm +an=998&year=2003&go=GO}; my %hash; push @{$hash{session}}, $session =~ /salesman=(\d+)/g;
HTH.

--

There are 10 kinds of people -- those that understand binary, and those that don't.

Replies are listed 'Best First'.
Re: Re: Populating an array reference in a hash with with a regex
by diakonos (Hermit) on Oct 01, 2002 at 18:15 UTC
    These are great! I had forgotton that CGI.pm worked that way as well. I was trying to do it as a map and wasn't accomplishing it very well. Thanks again all. Doug

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (8)
As of 2024-04-23 14:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found