in reply to Re: Excluding Words in RegEx
in thread Excluding Words in RegEx

Well, This is so simple, I think there must be more than your simple requirement.
I think so too!
I don't see any need to use Modern::Perl. I figure old fashioned Perl will work just fine.
#!/usr/bin/perl -w use strict; while (<DATA>) { print unless /\bgroup\b/; } =prints: This line is OK But keep this grouped content =cut __DATA__ This line is OK This line should be skipped: 'group' Drop this group too But keep this grouped content

Replies are listed 'Best First'.
Re^3: Excluding Words in RegEx
by CountZero (Bishop) on Nov 06, 2011 at 16:31 UTC
    I always start all my scripts with use Modern::Perl. It is less typing than use strict; use warnings; and it switches on all the "modern" features too.

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James