This script remove all HTML tags using HTML::TokeParser for perl. How do I save the output to disk?
This is the main dilemma that I am having. .. print write_1 ($t[1]);
Other then that this script works.
This is the main dilemma that I am having. .. print write_1 ($t[1]);
Other then that this script works.
Code:
#!/usr/local/bin/perl
# use strict;
use warnings;
use HTML::TokeParser;
########################
########################
my $parser = HTML::TokeParser->new('test.html') or die "fail - $!";
my $file1 = "_1.txt";
my $t = $t; # strict issue
# ...............................
# ...............................
while($t = $parser->get_token)
{
next if(($t->[0] eq 'S'));
if($t->[0] eq 'T')
{
print $t->[1];
}
else
{
### print $t->[-1];
}
}
# close (new);
# .........................
# .........................
open (write_1, "> $file1");
print write_1 $t->[1];
close (write_1);
exit(21);