our $FOO_HAS_BEEN_CALLED; sub foo { if (not $FOO_HAS_BEEN_CALLED) { call_me_only_once(); $FOO_HAS_BEEN_CALLED = 1; } }