I suspect it's because the hash %parvalues; is what you're trying to 'my' each iteration of that loop not the element parelement. If you want to my it try doing that before you enter the <output> loop. FWIW: I'd do something like %parvalues = (); before the while which should prevent warn/strict from complaining; (This could be the wrong to define an 'empty hash'; I think it works the same as a list/array however)