if ($file =~ /\.(html?|jpg|gif)) {
foo();
}