introduction to web programming The =~ operator Pattern matching can also be used to manipulate variables. In particular, many CGI scripts take advantage of the "=~" operator in conjunction with the substitution operator using the format

    $variable_name =~

For example, if we want to censor every occurrence of the word "Frack" from the client-defined input field "comment", we might use the line

     $form_data{'comments'} =~ s/frack/censored/gi;

Previous | Next | Table of Contents