in reply to search a regex list

$perm = 400 if $file =~ /catalina\.properties|\.key$|tomcat-users\.xml +/;
$perm = 400 if grep { $file =~ $_ }, qr/catalina.properties/, qr/\.key +$/, qr/tomcat-users.xml/;

Replies are listed 'Best First'.
Re^2: search a regex list
by equick (Acolyte) on Dec 12, 2010 at 10:49 UTC

    Thanks, that was exactly what I was looking for. (BTW I had to remove the comma after the curly bracket).

    What does qr do?

      equick:

      You can answer questions like this by referring to the documentation, e.g., perldoc perlop. You may want to review perldoc perldoc to see how to use perldoc, and review perldoc perl to find an overview of the basic documentation. There's also a rumor of a site on the internet called Google that can help you locate answers to simple questions like these.

      ...roboticus

      When your only tool is a hammer, all problems look like your thumb.