Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^2: Calling a function from within a HERE doc?

by jeffa (Bishop)
on Aug 16, 2005 at 21:03 UTC ( [id://484246]=note: print w/replies, xml ) Need Help??


in reply to Re: Calling a function from within a HERE doc?
in thread Calling a function from within a HERE doc?

While it presents a much steeper learning curve, Template-Toolkit is extremely clever and robust.

use strict; use warnings; use Template; use POSIX; my $tt = Template->new; $tt->process(\*DATA, { var_day => strftime("%D %r",localtime)} ) or die $tt->error; __DATA__ [% USE day = date(format => '%D %r') -%] >>[% var_day %]<< >>[% day.format(time) %]<<

Update: fixed funny tyepo -- s/learning curse/learning curve/

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (2)
As of 2024-04-25 06:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found