I'm tracking down a performance problem (likely some bad regexp) and have a file of existing regexps that is used to filter content. I have been away from Perl for too long a time...
So I want to read the file line by line and convert each to a regexp that I will apply against a reference text (32K) and record the time. The key is to identify the worst ones to look for rewriting. My logic to date is:
while (<FILE>) {
chomp{$_);
if(length $_ > 1)
{
$regex =~ $_;
$_=$sampletext;
if(/$regex/)
{
}
}}
I'm getting uninitialized values in pattern match and suspect that I have a minor error somewhere -- but can't spot it.
In reply to Reading and executing RegExp from text file by KLassesen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |