Emmanuel Quevillon > Template-Plugin-DataRandom > Template::Plugin::DataRandom

Download:
Template-Plugin-DataRandom-0.03.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.03   Source  

NAME ^

Template::Plugin::DataRandom - Plugin to access Data::Random method in Template Toolkit

SYNOPSIS ^

 [% USE r = DataRandom %]

 [% words = r.rndwrds(size => 10) %]

 [% chars = r.rndchrs(set => alpha, size => 5 %]

 [% set = r.rndset(set => ['string1', 'string2'], size => 5 %]

 [% enum = r.rndenum(set => ['string1', 'string2', .. ]) %]

 [% date = r.rnddate(min => '1998-12-31') %]

 [% time = r.rndtime(min => '12:00:00', max => 'now' ) %]

 [% dtime = r.rnddtime(min => '1978-9-21 4:0:0', max => 'now' ) %]

 [% img = r.rndimg(minwidth => '10', maxwidth => '80', bgcolor => [55,120,255]) %]

DESCRIPTION ^

This plugin has been made to create random data on demand in your template. It is deeply inspired from Adekunle Olonoh Data::Random module.

METHODS ^

rndwrds

This returns a list of random words given a wordlist. See below for possible parameters.

See "rand_words()" in Data::Random for more infos about available options.

rndchrs

This returns a list of random characters given a set of characters. See below for possible parameters.

See "rand_chars()" in Data::Random for more infos about available options.

rndset

This returns a random set of elements given an initial set. See below for possible parameters.

See "rand_set()" in Data::Random for more infos about available options.

rnddate

This returns a random date in the form "YYYY-MM-DD". 2-digit years are not currently supported. Efforts are made to make sure you're returned a truly valid date--ie, you'll never be returned the date February 31st. See the options below to find out how to control the date range.

See "rand_date()" in Data::Random for more infos.

rndtime

This returns a random time in the form "HH:MM:SS". 24 hour times are supported. See the options below to find out how to control the time range.

See "rand_datetime()" in Data::Random for more infos about available options.

rnddtime

This returns a random date and time in the form "YYYY-MM-DD HH:MM:SS". See the options below to find out how to control the date/time range.

See "rand_datetime()" in Data::Random for more infos about available options.

rndimg

This returns a random image. Currently only PNG images are supported. See below for possible parameters. See "rand_image()" in Data::Random for more infos about available options.

VERSION ^

0.03

AUTHOR ^

Emmanuel Quevillon, tuco@pasteur.fr

COPYRIGHT ^

Copyright (c) 2010 Emmanuel Quevillon. 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 ^

Template::Plugin, Data::Random

syntax highlighting: