for (@_) { if (/\.dat/) { # stuff to do here } }