pat_mc has asked for the wisdom of the Perl Monks concerning the following question:
my @files = ( "File1", "File2", ... ); my @regexes = ( 'verb [\w<>]+\s+/', 'noun \w+\s+/', ... ); for my $file ( @files ) { my $regex = qr/shift @regexes/; ... $sizes{ $version }{ $file } ++ if /$regex/; }
Presumably, it is just a small thing I am overlooking -- but I simply cannot get it. Ideally, what I want is a list of compiled regular expressions that I can simply fetch using shift and interpolate where needed. Your help in this matter hence would be much appreciated.Use of uninitialized value $regex in regexp compilation at ./compare.l +exicons.pl line ...
|
|---|