Fellow Monks,
I would like to hear your thoughts on the following...
I have a large bunch of html files... they are eventually going to be copied and any localisable strings in them (US strings naturally) is going to be replaced with locale text (German for example). Replacing the text in these files is easy enough, its pulling the relevant strings out to some text file for the translators thats giving me grief. I've tried using HTML::PullParser and it seems to work quite well at pulling out strings, any thoughts on how to get this to work for alt text aswell?? as its used quite a bit
#!/usr/bin/perl
use warnings;
use strict;
use HTML::PullParser;
OPEN (SOURCE, "Somehtmlfile.html")||die"Can't create $1: $!";
my @source=<SOURCE>;
close (SOURCE);
my @dest=strip ("@source");
print "@dest";
sub strip {
my $html = shift;
my $parser = HTML::PullParser->new(
doc => $html,
text => 'text',
);
my $result = '';
while(my $t = $parser->get_token) {
$result .= $t->[0];
}
return $result;
};
Am I going about this the right way?
Many Thanks
Martymart