in reply to Turning an argument into a regexp
my $regex = "\\.$searchfor"; $file =~ m/$regex/; [download]