Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

Re: Expression matching

by damian1301 (Curate)
on Apr 13, 2001 at 03:51 UTC ( #72246=note: print w/ replies, xml ) Need Help??

in reply to Expression matching

That because you have to backslash or else the Regex engine will consider it an array, which you don't want. I also see you are not using judging from you %FORM usage...check out this link for reasons why you should ...

Almost a Perl hacker.
Dave AKA damian

I encourage you to email me

Replies are listed 'Best First'.
(tye)Re: Expression matching
by tye (Sage) on Apr 13, 2001 at 23:40 UTC

    Make that "or else the Regex engine may consider it an array". This is actually one of the more magical parts of Perl parsing. Consider:

    #!/usr/bin/perl -w use strict; my $m= 'aeiou'; my @m= qw( a e i o u ); my $at= 'tye@perlmonks'; my $dollar= 'tye$perlmons'; sub Try { local( $" )= ","; print "(@_)\n"; } Try $at =~ /[@m]+/g; Try $at =~ /[m@]+/g; Try $dollar =~ /[$m]+/g; Try $dollar =~ /[m$]+/g; __END__ Outputs: (e,e,o) (@,m) (e,e,o) /[m5.006+/: unmatched [] in regexp at line 12.

    The "rules" that control this defy simple explanation so I'll just refer you to the source code. Simply search for "weight" in the Perl source code (it is only ever mentioned in the code for this parsing which is located in the file toke.c).

            - tye (but my friends call me "Tye")
Re: Re: Expression matching
by Beatnik (Parson) on Apr 13, 2001 at 13:25 UTC
    ofcourse he could be using something like

    foreach($query->param) { $FORM{$_} = $query->param($_); }

    but that would be kinda silly :)

    ... Quidquid perl dictum sit, altum viditur.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://72246]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2016-08-27 23:22 GMT
Find Nodes?
    Voting Booth?
    The best thing I ever won in a lottery was:

    Results (390 votes). Check out past polls.