#!/bin/perl use HTML::Parser; my $file= shift; my $p = HTML::Parser->new(api_version => 3, handlers => { text => [\@array, "text"] }); $p->parse_file( $file); print $_->[0] foreach @array;