@l = readdir(PRINT) ; %h{@l} = (1) x @l ; delete @h{'.', '..'} ; for( keys %h ) { # do work }