Help for this page
if (not $P::x) { $P::x = 1; f(); }
use strict; use warnings; ... sub f() { #No op. }
Benchmark: timing 5000 iterations of alt_1, alt_2, orig... alt_1: 3 wallclock secs ( 3.08 usr + 0.00 sys = 3.08 CPU) @ 16 +23.38/s (n=5000) ... alt_1 1623/s -- -58% -59% alt_2 3876/s 139% -- -3% orig 4000/s 146% 3% --