nmerriweather has asked for the wisdom of the Perl Monks concerning the following question:
i can match fine, but my issue is this:my %patterns = { { 'regex' => qr/^\/section\/([\d]{1,8})[\/]?$/, 'function' => 'do__section', 'id_fields' => ['section_id'] } }
unfortunately, $$i doesn't work (which would be $1)my @fields = @{$$regex_set{'id_fields'}}; unshift @fields, ''; my %args; for ( my $i=1; $i<=$#fields ; $i++ ) { $args{$fields[$i]} = $$i; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: regex question - dynamically address captures
by GrandFather (Saint) on Feb 21, 2006 at 23:00 UTC | |
by ikegami (Patriarch) on Feb 21, 2006 at 23:15 UTC | |
by GrandFather (Saint) on Feb 21, 2006 at 23:22 UTC | |
by ikegami (Patriarch) on Feb 21, 2006 at 23:28 UTC | |
by nmerriweather (Friar) on Feb 21, 2006 at 23:23 UTC | |
by jkeenan1 (Deacon) on Jul 19, 2006 at 03:15 UTC | |
by ikegami (Patriarch) on Jul 19, 2006 at 04:57 UTC | |
| |
by jkeenan1 (Deacon) on Jul 09, 2006 at 00:54 UTC |