#!/usr/bin/perl -w use strict; my @array = qw(one two three); &one; sub one { local $::i; foreach $::i(@array) { &two; } } sub two { print "$::i\n"; }