foreach (1..5){ hallo (); } sub hallo { $ab++; print $ab, "\n"; }