Help for this page

Select Code to Download


  1. or download this
    %constants = ( 'foo' => 'bar', 'baz' => 'bap' );
    
    $pattern = join('|', map(quotemeta($_), keys %constants) );
    
    eval("s{($pattern)}{\$constants{\$1)}e");