NAME
Convos::Core::Util - Utility functions for Convos
SYNOPSIS
"import" can export any of the "FUNCTIONS".
FUNCTIONS
as_id
$id = as_id @str;
This method will convert the input to a string which can be used as id attribute in your HTML doc.
It will convert non-word characters to ":hex" and join @str
with ":00".
format_time
$str = format_time $timestamp, $format;
id_as
@str = id_as $id;
Reverse of "as_id".
logf
$c->logf($level => $format, @args);
$c->logf(debug => 'yay %s', \%data);
Used to log more complex datastructures and to prevent logging undef
.
pretty_server_name
$str = pretty_server_name($server);
Removes "ssl\.", "irc.", "chat." from the beginning and ".com", ".org", ... from the end. Converts all non word and "_" to "-". Also removes the port.
Also has special handling for $servers matching...
$server | $str
-------------|-------
irc.perl.org | magnet
efnet | efnet
AUTHOR
Jan Henning Thorsen - jhthorsen@cpan.org