Next Tricks of the Wizards 89

Function Tracing

     package Trace;
     use Filter::Simple;
     sub trace { ... }        
     FILTER_ONLY code => sub {
       s{^(\s* sub \s+ [a-zA-Z_]\w* \s* \{)}
        {$1 &Trace::trace; }xmg;
     };
        $z = "
        sub z {
         Oh no!
        }
        ";
        $z = \034\000\000\000\001\034;


Next Copyright © 2003 M. J. Dominus