use strict; use warnings; while() { my $line = $_; if($line =~ m/<.*>([^>]+)<.*>/g) { my $new = substr($line,0,10); print "THE NEW LINE is : $new\n"; print "capture only : $1\n"; } } __DATA__ tove