List Info

Thread: match question




match question
country flaguser name
United States
2007-05-20 12:15:34

Input from a form looks like
A=1&B=2&C=3

I am trying to match
/B=+[&||s]/ # which should match B=2
but I want to assign the match to a variable like this
$_= "A=1&B=2&;C=3";
$B = /B=+&/;

Why do I want to do this?
I thought it would be more secure to do this instead of
splitting the input at the "&;"'s
and then again at the "="'s
and then assign the names and values to hashes
$Input{$key}=$Value

this way I just take form the input string exactly what I need and ignore
the rest.
it also makes it easier to just pass the $input to a subroutine or a package

So... ok.. I'm probly doing it all wrong... i'm am amature perl programer
who programs for fun.
thanks
Lou

__._,_.___
.

__,_._,___
test-- do not read
country flaguser name
United States
2007-05-20 18:32:19

my reply emails are bouncing but my new emails are not.
this is a test, replying to my own email

__._,_.___
.

__,_._,___
Re: match question
country flaguser name
United States
2007-05-21 06:39:20

The code below is a option for do what you want:

<code&gt;
use CGI qw/:standard/;

if (param) {
subrotineBlah(param('B'));
}
</code>

HTH.

On 5/20/07, Lou Hernsen < lhernsen1015%40wowway.com">lhernsen1015wowway.com> wrote:
&gt;
> Input from a form looks like
>; A=1&B=2&C=3
>
>; I am trying to match
&gt; /B=+[&||s]/ # which should match B=2
> but I want to assign the match to a variable like this
>; $_= "A=1&amp;B=2&;C=3";
> $B = /B=+&/;
>
> Why do I want to do this?
&gt; I thought it would be more secure to do this instead of
> splitting the input at the "&;"'s
> and then again at the "=&quot;'s
>; and then assign the names and values to hashes
&gt; $Input{$key}=$Value
>
&gt; this way I just take form the input string exactly what I need and ignore
&gt; the rest.
&gt; it also makes it easier to just pass the $input to a subroutine or a
> package
>
> So... ok.. I'm probly doing it all wrong... i'm am amature perl programer
> who programs for fun.
>; thanks
&gt; Lou
>
>
>

--
Thiago Nascimento
perl -e '$_="tMM naaCt Feocmama_itpUilucoGa";$_.=$1,print $2 while
s/(..)(.)//;print substr$_,1,1;'
&quot;...just because I don't know the meaning of my art, does not mean it has no
meaning..." S.D.

[Non-text portions of this message have been removed]

__._,_.___
.

__,_._,___
[1-3]

about | contact  Other archives ( Real Estate discussion Medical topics )