I think you meant to say grep /^1$/, @array
In reply to Re^2: Foreach loop by Bloodnok in thread Foreach loop by PetreAdi