$SOURCE='stuff.src'; $COMP='stuff.pm'; require $COMP; *dostuff=\&Stuff::dostuff; while (<>) { if (-M $SOURCE < -M $COMP) { # source changed? print "compiling...\n"; system "cp $SOURCE $COMP"; # ok, fake compilation delete $INC{$COMP}; # make sure 'require' will load the module no warnings; # avoid some warnings require $COMP; *dostuff=\&Stuff::dostuff; # import } dostuff($_); }