__PACKAGE__->run(@ARGV) if -e '/path/to/run-me.flag' && ! caller; sub run { # ... the work goes here... }