in reply to Regex Dangerous??

Though I just found out I'd have to use something like:
$input{'variable'} =~ s/\\/\\\\//gs;
because otherwise you get a server error if you simply type in '\'

Replies are listed 'Best First'.
Re: Re: Regex Dangerous??
by merlyn (Sage) on Mar 23, 2001 at 04:55 UTC
    Well, you'll get server errors for a lot more than that. Any invalid regex will bollux you. What you need to do is wrap it in an eval block, and capture the $@ variable. Standard exception-handling stuff.

    -- Randal L. Schwartz, Perl hacker