Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Including TT2 templates in module distributions

by ikegami (Patriarch)
on Jan 20, 2006 at 16:31 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://524515]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2024-04-19 22:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found