Next Tricks of the Wizards 87

"Only perl can parse Perl"

        $u = blub / 3;          # Is this a comment? /;
        package Blub;
        use Astro::MoonPhase;
        sub import {
          my $caller = caller;
          my ($phase) = phase(time());
          if (0.4 < $phase && $phase < 0.6) {
            *{$caller . "::blub"} = sub () { 1 };
          } else {
            *{$caller . "::blub"} = sub ($) { $_[0] };
          }
        }



Next Copyright © 2003 M. J. Dominus