#!/usr/bin/perl use strict; use warnings; my $extensions = qr/\.doc|\.gif/; my @files = qw(test.doc test.gif test.png test.jpg); for(@files){ if($_ =~ $extensions){ print "yes\n"; } }
In reply to Re: how to get the String as regularexpression
by reneeb
in thread how to get the String as regularexpression
by arunmep
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |