S_Shrum has asked for the wisdom of the Perl Monks concerning the following question:
I am attempting to create a cursoring subroutine that will allow me to create what I call a slice navigation string.
My script allows for a "&slice=" parameter to indicate what slice to show. This works along with my "&max=" parameter to indicate how many records to show per slice.
What I will have is a $ENV{'REQUEST_URI'} whice will contain the "slice=" string in it along with a number. There are however 3 possibilities; they are:
FIRST PARAM: slice=[SOME_NUMBER]&this=that
MIDDLE-ISH PARAM: this=that&slice=[SOME_NUMBER]&that=this...
LAST PARAM: this=that&that=this&slice=[SOME_NUMBER]
What I am looking for is a regex that would create a pre and post string that would do the equivilant of (using the first example:
$pre = "slice="
$post = "&this=that"
so that I can loop and insert numbers into my new URI
slice=1&this=that
slice=2&this=that
slice=3&this=that
...
slice=100&this=that
.....
and so on, and so on. I've been trying to do this myself but have had no luck in getting a regex to address all three scenarios.
TIA
======================
Sean Shrum
http://www.shrum.net
Fixed square brackets 2002-02-27 - dvergin
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Need to create a pre and post string from a REQUEST_URI
by Kanji (Parson) on Feb 28, 2002 at 04:10 UTC | |
|
Re: Need to create a pre and post string from a REQUEST_URI
by thpfft (Chaplain) on Feb 28, 2002 at 14:02 UTC | |
|
Re: Need to create a pre and post string from a REQUEST_URI
by S_Shrum (Pilgrim) on Mar 01, 2002 at 07:18 UTC | |
|
Re: Need to create a pre and post string from a REQUEST_URI
by data64 (Chaplain) on Feb 28, 2002 at 02:09 UTC | |
|
Re: Need to create a pre and post string from a REQUEST_URI
by screamingeagle (Curate) on Feb 28, 2002 at 04:04 UTC |