in reply to Re: Slurping and s/// a group of files from a list
in thread Slurping and s/// a group of files from a list
use HTML::TokeParser::Simple; my $p = HTML::TokeParser::Simple->new( $filename ); while ( my $token = $p->get_token ) { if ( $token->is_tag('img') && !defined $token->get_attr('alt') ) { $token->set_attr('alt', $alt_text{ $token->get_attr('src') } ); } print $token->as_is; }
|
|---|