use strict; use warnings; foreach (1..5){ hallo (); } sub hallo { my $ab; sub counter { no warnings; return ++$ab; } print counter(), "\n"; }