Reference

Zim::Utils(3pm)

Some useful functions and objects for zim.

NAME

Zim::Utils - Some useful functions and objects for zim.

DESCRIPTION

This package contains various utilities needed by the zim modules.

EXPORT

By default the methods "__()", "__actions()", "file()", "dir()" and "buffer()" are exported.

METHODS

"file(@PATH)"

Returns a new "Zim::FS::File" object.

"dir(@PATH)"

Returns a new "Zim::FS::Dir" object.

"uri(@URI)"

Returns a new "Zim::FS::URI" object.

"buffer(\$STRING)"
"buffer(@STRING)"

Returns a new "Zim::FS::Buffer" object.

"find_translation()"

Tries to load messages for the current locale.

"__(STRING, PARAM =" VALUE, ...)>

Return a translation for STRING. Parameters can be placed in the string using "{PARAM}" syntax.

"__actions(BLOCK)"

Wrapper for "__()" that can be used to translate actions.

"parse_date(STRING)"

Parses various date strings and returns a list of year, month and day. If the year is missing a reasonable guess is given. Similar for the century.

Supported formats:

        dd/mm           d/mm d/m dd/m
        dd/mm/yy        ...
        dd/mm/yyyy      ...
        yyyy_mm_dd      yy_m_d ...
        yyyy mm dd      yy m d ...
        yyyy:mm:dd      yy:m:d ...

TODO: Add other common date formats ?

"parse_date_l(STRING)"

Like "parse_date()" but returns a list similar to "localtime()". If STRING is an integer it calls "localtime()" directly.

"run(PROGRAM, ARG, ...)"

Run background process (fork + exec).

"strftime(FMT, @TIME)"

Wrapper for the "strftime" in POSIX function. Takes care of portability of "%e".

AUTHOR

Jaap Karssenberg (Pardus) <[email protected]>

Copyright (c) 2007 Jaap G Karssenberg. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO