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

Re: Including TT2 templates in module distributions

by ikegami (Pope)
on Jan 20, 2006 at 16:31 UTC ( #524515=note: print w/replies, xml ) Need Help??


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 16:40 UTC

    Yeah, that'll do it.

    Marvellous, thanks very much.


    MB

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2020-10-26 13:45 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favourite web site is:












    Results (251 votes). Check out past polls.

    Notices?