Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

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 CGI.pm 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


Comment on Re: Expression matching
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 :)

    Greetz
    Beatnik
    ... Quidquid perl dictum sit, altum viditur.
(tye)Re: Expression matching
by tye (Cardinal) 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 reinterp.pl 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")

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2014-12-27 01:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls