use Sub::Lexical; my sub foo { print "I'm in a lexically scoped sub, hurrah!\n"; } foo();