hello,
I have a page that uses a passed in number ($currnum), then checks if any files exist for that number from the specified page. For some reason, the page tends to slow down a lot at the readdir line, and, thru testing, I am positive it is that line. This is chunk of code as it currently stands, but I have had the \Q before the ^, as well as not there at all. Does anyone have any idea on what could be slowing it down so much at this spot? Any help is appreciated.
my $DIR = $ROOT.'temp';
opendir(DR,$DIR);
my $spot='page82.'.$currnum;
@EDITS = grep /^\Q$spot/, readdir DR;
I have a page that uses a passed in number ($currnum), then checks if any files exist for that number from the specified page. For some reason, the page tends to slow down a lot at the readdir line, and, thru testing, I am positive it is that line. This is chunk of code as it currently stands, but I have had the \Q before the ^, as well as not there at all. Does anyone have any idea on what could be slowing it down so much at this spot? Any help is appreciated.
my $DIR = $ROOT.'temp';
opendir(DR,$DIR);
my $spot='page82.'.$currnum;
@EDITS = grep /^\Q$spot/, readdir DR;