Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
We don't bite newbies here... much
 
PerlMonks  

Re: Including TT2 templates in module distributions

by ikegami (Patriarch)
on Jan 20, 2006 at 11:31 UTC ( [id://524515]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to Including TT2 templates in module distributions

You could put them in a dir relative to your module, then use %INC to locate them.

use My::Module; use File::Spec; my $path = $INC{'My/Module.pm'}; $path = File::Spec->rel2abs($path); my ($vol, $dir, $file) = File::Spec->splitpath($path); $path = File::Spec->catpath($vol, $dir, ''); $path = File::Spec->catdir($path, 'templates'); print("$path\n");

Update: splitpath didn't work with relative directories. Fixed.

Replies are listed 'Best First'.
Re^2: Including TT2 templates in module distributions
by matthewb (Curate) on Jan 20, 2006 at 11:40 UTC

    Yeah, that'll do it.

    Marvellous, thanks very much.


    MB

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://524515]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.