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