use File::Slurp; my $text = read_file( 'filename' ) ; $text =~ s!<[^>]+>!!g;