############################################################ #specifica cosa deve fare la subroutine edit ############################################################ sub edit { my $file = $_; # only operate on html files if ((-e $file) && (! -d $file) && (/.html?/)){ open (FH, "<",$file) || die $!; my $tree = HTML::Tree->new(); $tree->parse_file($file) || die $!; # The main div contains the post of interest my $getmaindiv = $tree->look_down(_tag => "div",id => "post_principale") || die $!; print $getmaindiv->as_HTML, "\n"; close FH; } }