Acme::Time::Baby - tell time little children can understand.
print babytime; # Prints current time.
use Acme::Time::Baby language => 'du';
print babytime "10:15"; # Prints a quarter past ten in a way
# little Dutch children can understand.
Using this module gives you the function babytime, which will return the time in the form The big hand is on the ten and the little hand is on the three. If no argument to babytime is given, the current time is used, otherwise a time of the form hh:mm can be passed. Both 12 and 24 hour clocks are supported.
When using the module, various options can be given. The following options can be passed:
The language the time should be told in. The following languages are currently supported:
en English (this is the default)
br Brazilian Portuguese.
ceb Cebuano (Filipine dialect)
de_ch Swiss German.
swedish chef Swedish Chef (from the Muppets).
If no language argument is given, English is used.
Note that some languages use accented letters. The returned sentences are correct for an ISO 8859-1 platform.
This is the format used to represent the time. It will be passed to sprintf, and it should have two %s formatting codes. The other two arguments to sprintf are the position of the minute hand (the big hand) and the hour hand (the little hand). If you have perl 5.8 or above, you could use %2$s and %1$s to reverse the order.
An array with the names of the numbers one to twelve, to be used in the formatted time.
By default, the sub babytime will be exported to the calling package. If for some reason the calling package does not want to import the sub, there are two ways to prevent this. Either use use Acme::Time::Baby (), which will prevent Acme::Time::Baby::import to be called, or pass noimport followed by a true value as arguments to the use statement.
What's New in This Release: [ read full changelog ]
· Remove use of $[ - this is deprecated.