soap has asked for the wisdom of the Perl Monks concerning the following question:
Greetings,
I have a string formatted closely to the following example:
examplestringofrandomlength/userid=6&refid=49
I am trying to extract the two numbers and insert them into their own scalars so that:
$num1 = 6
$num2 = 49
Also note that the first number(6) will always be between 1-6 whereas the second number(49) ranges from 1-9999.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Extracting two numbers from a string
by BrowserUk (Patriarch) on May 28, 2010 at 17:17 UTC | |
|
Re: Extracting two numbers from a string
by toolic (Bishop) on May 28, 2010 at 17:16 UTC | |
by soap (Initiate) on May 28, 2010 at 17:31 UTC | |
|
Re: Extracting two numbers from a string
by kennethk (Abbot) on May 28, 2010 at 17:14 UTC | |
|
Re: Extracting two numbers from a string
by syphilis (Archbishop) on May 28, 2010 at 22:38 UTC | |
|
Re: Extracting two numbers from a string
by Anonymous Monk on May 28, 2010 at 21:34 UTC |