home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


Perl CookbookPerl CookbookSearch this book

20.5. Converting HTML to ASCII

20.5.2. Solution

If you have an external formatter like lynx, call an external program:

$ascii = `lynx -dump $filename`;

If you want to do it within your program and don't care about the things that the HTML::FormatText formatter doesn't yet handle well (tables and frames):

use HTML::FormatText 3;
$ascii = HTML::FormatText->format_file(
  $filename,
  leftmargin => 0, rightmargin => 50
);


Library Navigation Links

Copyright © 2003 O'Reilly & Associates. All rights reserved.