If you only want to match a line that contains both --gnu and -D and then further process the matching line, the following may give you some ideas. Only line 4 satisfies both your conditions and is matched.
use strict; use warnings; while(<DATA>){ chomp; if ($_ =~ m/--gnu.+-D/g){ print "Matched: $_\n"; # Add code for further processing } } __DATA__ 1. xyz --abc 2. xyz --gnu abc 3. abc -Dxyz 4. xyz --gnu abc -Dxyz def
In reply to Re: Processing .RES file
by arun_kom
in thread Processing .RES file
by raghvens
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |