in reply to New to Perl

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.)