> Hi all > > perl script below works, and does what I hoped it would, but > I don't seem to understand how to get it to print out the > result to a new file as opposed to stdout. > > Thanks for any help > > #!/usr/bin/perl -w > use strict; > use HTML::Parser; > > open(OUT, ">/share/file1") || die "Cannot open /share/file1: $!\n"; > > my $html = HTML::Parser->new( > api_version => 3, > text_h => [sub{ print shift;}, 'dtext'],
text_h => [sub{ print OUT shift;}, 'dtext'], In this case, you're not printing to the file handle Or you could assign the stuff to a vars and use the File::Slurp Module to add it to a file in one line. > start_h => [sub{ print shift;}, 'text'], > end_h => [sub{ print shift;}, 'text']); > > $html->ignore_tags(qw(!? table body span img p br hr td tr > font i b h1 a)); $html->parse_file("/share/input.txt"); > $html->eof; > > close(OUT); > > > > -- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]