in reply to Re^2: Large File Parsing
in thread Large File Parsing
I'm guessing from the variable name and the use of quoting constructs that the OP grabbed that bit of code from one of my solutions, probably one where @items contained values known not to need quotemeta'ing. Invariable application of quotemeta without any consideration of whether it is necessary is just another form of cargo cult programming. I don't think we can tell from the OP's code whether it is required or not. Even if it is required, the do block construct is as valid as using join.
my $rxMatchItems = do { local $" = q{|}; qr{(?:@{ [ map quotemeta, @items ] })}; };
Cheers,
JohnGG
|
|---|