in reply to Re: Re: Problem with assignment for class...
in thread Problem with assignment for class...

You still didn't read perlre as recommended, did you?

"+" is a quantifier. It makes no sense as the only thing in a regexp. It has to modify something. Finding a nonsensical syntax within a regular expression will cause an error, because regular expressions are a built-in part of Perl.

If you want to match the literal character "+" you can do so by escaping it, or by metaquoting it:

s/\+/ / # or s/\Q+\E/ /

But you really shouldn't be parsing your own CGI parameters. Use the CGI.pm module, at least until you understand why this advice is important.

As for additional reading: The CGI.pm POD. And perlretut, and perlre, and perlrequick all provide good reading material on regular expressions, each targeting a different stage in your learning curve.


Dave


"If I had my life to do over again, I'd be a plumber." -- Albert Einstein

Replies are listed 'Best First'.
Re: Re: Re: Re: Problem with assignment for class...
by MTXperience (Initiate) on Oct 05, 2003 at 02:30 UTC
    I realized as soon as I posted my previous reply, that the '+' had to be entered as a '/+' for syntax reasons, the reason this wasn't readily aparent is because as I said... it's in my textbook. The textbook in question is "Weaving a Website" by Susan Anderson-Freed, and has actually been quite good to this point.
      Get a new textbook then, or just stick with the perl documentation