in reply to how to get the String as regularexpression
#!/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"; } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: how to get the String as regularexpression
by davorg (Chancellor) on Oct 03, 2006 at 14:43 UTC |