in reply to Re^3: Perl grep an array of values in a file
in thread Perl grep an array of values in a file

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re^5: Perl grep an array of values in a file
by Anonymous Monk on Jan 15, 2015 at 21:37 UTC

    I see you found that here... unfortunately what you've posted contains one bug and one potential bug:

    my @typedefs = qw(acuser, replica_sync_cmd, 2015/01/13);

    That doesn't do what you expect it to, Perl even warns about that: "Possible attempt to separate words with commas ...". What you want is

    my @typedefs = qw(acuser replica_sync_cmd 2015/01/13);

    because qw// splits on whitespace, not commas.

    Also, if @typedefs contains literal strings to be matched, you'll want to write the regex as /\Q$_/.