Help - Search - Member List - Calendar
Full Version: using HTML::FromText
WorkTheWeb Forums > Webmaster Resources > Perl Beginner Help
Support our Sponsors!
Owen
Could someone tell me how I am not using the HTML::FromText module correctly

This is more or less copied from the documentation but does not produce html?

TIA

Owen


#!/usr/bin/perl

use HTML::FromText;
use strict;

my $text = '/data/PerlScripts/test.txt';

my $html = text2html(
$text,
urls => 1,
email => 1,
);

print "$htmln";
----------------------------------
produces

/data/PerlScripts/test.txt

----------------------------------

This is $text


Functional interface that just wraps the OO interface.
This function is exported by default. If you don't want it you can http://www.cpan.org require
the module or use [Email Removed] it with an empty list.

Ing. Branislav Gerzo
Owen [O], on Tuesday, June 21, 2005 at 14:56 (+1000) typed the
following:

O> my $text = '/data/PerlScripts/test.txt';

this is your text you'd like to convert, or it is textfile, where you
have content you'd like to convert ? I think the 2nd option is right,
so you need to:

my $file = '/data/PerlScripts/test.txt';
my $content = do { local $/; open(my($fh), "<", $file) or die "$file $!n"; <$fh>};
....


--

How do you protect mail on web? I use http://www.2pu.net

[Calvin: I achieve a lower consciousness.]


PHP Help | Linux Help | Web Hosting | Reseller Hosting | SSL Hosting
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2005 Invision Power Services, Inc.