for (@filenames) { s/CSS//; } # or written with a statement modifier: # s/CSS// for @filenames;