On Fri, 26 Apr 2002, Tatsuhiko Miyagawa wrote:

> Here's yet another funny Inline plugin - Inline::TT

Hi.

I did some similar work on this quite a while back (looking at my file
system, December 2001.)  I was waiting for ingy to make some changes to 
Inline to allow options to be passed directly to the load method so that I 
could specify things like:

 Inline 'Template' => INCLUDE_DIR => "/my/inc/dir"

That thread started here: 
http:[EMAIL PROTECTED]/msg00895.html

My code is here:
http://2shortplanks.com/temp/it/Template.pm (src)
http://2shortplanks.com/temp/it/Inline-Template-0.1.tar.gz (dist & tests)

Note that the 01include.t file will fail, as the changes haven't been 
implemented yet.  Also notice that the Pod is still mostly from 
Inline::Webchat (where I stole most of the code structure from)

I looked at your code and I think there are a few differences in the
implementation between your code and mine (I'm not sure, I haven't run
this a quite a few months.)  I make some attempt to localise the varibles
that are passed as arguments by hand so that you could have things like
counters in the templates that still work (and don't get knobbled by TT's
own localisation)

e.g. (from the tests)

# can we pass arguments
is(echo(text => "foo"),"foo", "parameter passing");

# should not see "foo" now
is(echo(),"","stash localisation");

# check the counter
counter();
is(counter(),"2","variable passing");

__END__

__Template__

[% BLOCK echo %][% text %][% END %]
[% BLOCK counter %][% n = n + 1 %][% n %][% END %]


Does that make sense?  Maybe you want to steal my code (or more likely, 
re-implement it better)

As I said, I was pretty much waiting for another version of Inline with 
the ability to access import() parameters withing an ILSM's load() 
method.

Later.

Mark.

-- 
s''  Mark Fowler                                     London.pm   Bath.pm
     http://www.twoshortplanks.com/              [EMAIL PROTECTED]
';use Term'Cap;$t=Tgetent Term'Cap{};print$t->Tputs(cl);for$w(split/  +/
){for(0..30){$|=print$t->Tgoto(cm,$_,$y)." $w";select$k,$k,$k,.03}$y+=2}

Reply via email to