Next | Tricks of the Wizards | 87 |
$u = blub / 3; # Is this a comment? /;
Where did blub come from?
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] }; } }
This program parses differently when the moon is full
So to fully parse all Perl programs, you must be able to determine the phase of the moon
And that's why only perl can parse Perl
Nevertheless, filters can do reasonably well in practice
Next | Copyright © 2003 M. J. Dominus |