@open = `cat temp.html`; foreach (@open) { $_ =~ s/\n//ig; if ( "$_" eq "<(.*)>" ) { print "html: $_\n"; }else{ print "text: $_\n"; } } exit;