in reply to extracting lines

Try unless instead of if.
print OUT unless (/phn_a/ .. /1ord/);
UPDATE: more detailed:
#!/usr/bin/perl use strict; use warnings; while (<DATA>) { print unless (/phn/ .. /1ord/); } __DATA__ black # input phn blue red green # 1ord yellow white

Replies are listed 'Best First'.
Re^2: extracting lines
by Anonymous Monk on Jul 02, 2004 at 10:43 UTC
    this appears to print everything in the file, no change
      sorry just seen the update
        only problem here, is that it omits everything e.g
        # phn .. .. # xxxxx # phn .. .. # 1ord
        so here the code would onit both rather than just the second?