while () { chomp ; @array = split ; # do something with @array } #### while () { $line = $_ ; chomp $line ; $line =~ s/^\s// ; # delete leading whitespace, if any @array = split /\s+/,$line ; # do something with @array; $_ is preserved so you # can use it again }