NAME
Tie::Function - wrap functions in tied hash sugar
SYNOPSIS AND EXAMPLE
use Tie::Function 0.01;
tie my %a, Tie::Function => sub{join '_'x$_[0],qw/( | )/};
print "small: $a{1}\nmedium: $a{2}\nwide: $a{3}\n";
# we split on $; to recover multiple arguments
tie my %times, Tie::Function => sub{
$_[0] * $_[1]
};
print "3 times 5 is $times{3,5}\n"
DESCRIPTION
Tie::Function simplifies wrapping functions in tied hash syntax so they can be interpolated in double-quoted literals without messy intermediate variables.
EXPORT
nothing
HISTORY
0.01
AUTHOR
Copyright (C) 2004 david nicol davidnico@cpan.org released under your choice of the GNU Public or Artistic licenses