use strict; while(<>) { push(@files) if /\.sgml$/; }