in reply to noob regexpression question
Although not a *compile* error, you should replace m/exe/ and m/dll/ with m/\.exe$/i and m/\.dll$/i.
By the way, the following is equivalent (minus the prints) to your code:
or the more memory-efficientchomp(@exeDllLines); my @dllarray = grep { /\.(?:dll|exe)$/i } @exeDllLines;
chomp(@exeDllLines); my @dllarray; foreach (@exeDllLines) { push @dllarray, $_ if /\.(?:dll|exe)$/i; }
Update: Oops, not quite. I didn't see the square brackets around DLLs.
|
|---|