If the lines are distinguishable by them containing 2 '*'s, or not, then this would do the job:
if( m[\*[^*]+\*] ) { print "file 1: $_"; } else { print "file 2: $_"; }
The trick with regexes is only specify as much as you actually need.
(Actually, only doing as much as is needed is a programming tenet that gets far too little respected.)
In reply to Re: New to Perl
by BrowserUk
in thread New to Perl
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |