These are the shortest, most correct ones so far for #1 and #2 respectively. They're sort of a mis-mash of all the suggestions so far. Ian's improved if/ifndef/ifdef/etc... regex is used, as is Mike's \b suggestion.
perl -ne '/^\s*#(?!\s*((ifn?|un)def|(el|end)?if|define|include|else)\b)/||print' perl -ne '(1../^#!.*perl/i)|/^\s*#(?!\s*((ifn?|un)def|(el|end)?if|define|include|else)\b)/||print' -- Michael G. Schwern <[EMAIL PROTECTED]> http://www.pobox.com/~schwern/ Perl6 Quality Assurance <[EMAIL PROTECTED]> Kwalitee Is Job One Here's hoping you don't harbor a death wish!
