sub Foo::INIT { print "Hello world\n" } &Foo::INIT;
I think I'm responsible for this one, more or less. For a while I was thinking that BEGIN, CHECK, INIT and END were actually subroutines. Well, they aren't. They're "magic" code blocks, that just happen to allow a "sub" prefix to confuse the hell out of everybody. Which is where the obfuscation In the BEGINning is based on.
Note that you can actually call subroutines named BEGIN, CHECK, INIT or END, but you need a special action to get them defined:
*Foo::INIT = sub { print "Hello world\n" }; &Foo::INIT;
__END__
Hello world
Liz