in reply to Problem With Perl IRC Server

The one-liner
perl -e "$a='Rob89$';print$a.':';$a=~s/(\W)/\\$1/g;print$a;"
produces a string where everything that might be magical is escaped. Would that work?

--t. alex

"Of course, you realize that this means war." -- Bugs Bunny.

Replies are listed 'Best First'.
Re: Re: Problem With Perl IRC Server
by Juerd (Abbot) on Jan 26, 2002 at 23:08 UTC
    Perl has that built-in, and it's called quotemeta.

    2;0 juerd@ouranos:~$ perl -e'undef christmas' Segmentation fault 2;139 juerd@ouranos:~$