Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: HTML::Template and filehandle ?

by davorg (Chancellor)
on Jul 21, 2009 at 15:25 UTC ( [id://781992]=note: print w/replies, xml ) Need Help??


in reply to HTML::Template and filehandle ?

As far as I can tell there isn't an HTML method/tag to include external text files like this.

Server side includes, perhaps?

You are creating a HTML::Template variable called FILE. And that contains the contents of the Perl variable $ioref. And that contains a filehandle. So you shouldn't really be surprised if you get the filehandle printed out instead of the contents of the file. If you want the contents of the file, then you'll need to read the file.

$template->param(FILE => do { local $/; <FH> });
--

See the Copyright notice on my home node.

Perl training courses

Replies are listed 'Best First'.
Re^2: HTML::Template and filehandle ?
by gctaylor1 (Hermit) on Jul 22, 2009 at 00:18 UTC
    Thanks daveorg!

    That works as advertised. It doesn't look like I want it to look but that's a topic for another node.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://781992]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2024-04-19 23:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found