O'Reilly logo

Sams Teach Yourself Perl in 21 Days, Second Edition by Rafe Colburn, Laura Lemay

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Text-to-HTML Converter Script

Let's finish up with a slightly more useful script: webbuild.pl takes a simple text file as an argument, prompts you for some basic values, and then spits out an HTML version of your text file. It's not a very sophisticated HTML generator—it won't handle embedded boldface or other formatting, it doesn't handle links or images; really, it does little other than stick paragraph tags in the right place, let you specify the foreground and background colors, and give you a simple heading and a link to your e-mail address. But it does give you a basic HTML template to work from.

How It Works

In addition to simply converting text input to HTML, the webbuild.pl script prompts you for several other values, including

  • The title ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required