Stefan Hornburg (Racke) > Template-Flute-0.0066 > Template::Flute::Utils

Download:
Template-Flute-0.0066.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Source   Latest Release: Template-Flute-0.0119

NAME ^

Template::Flute::Utils - Template::Flute utility functions

FUNCTIONS ^

derive_filename FILENAME SUFFIX [FULL] [ARGS]

Derives a filename with a different SUFFIX from FILENAME, e.g.

    derive_filename('templates/helloworld.html', '.xml')

returns

    templates/helloworld.xml

With the FULL parameter set it can be used to produce a path for a relative filename from another filename with a directory, e.g.

    derive_filename('templates/helloworld.html', 'foobar.png', 1)

returns

    templates/foobar.png

Also, with the pass_absolute argument a SUFFIX containing an absolute file path will be returned verbatim, e.g.

    derive_filename('templates/helloword.html',
                    '/home/racke/components/login.html',
                    1,
                    pass_absolute => 1)

produces

   /home/racke/components/login.html

AUTHOR ^

Stefan Hornburg (Racke), <racke@linuxia.de>

LICENSE AND COPYRIGHT ^

Copyright 2010-2013 Stefan Hornburg (Racke) <racke@linuxia.de>.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.

syntax highlighting: