#!/usr/bin/perl -w
#
# Example of using a hash to store code.
#
# Joel Franusic 2007
use strict;
my %code = (
'as_reversed' => sub {
my @in = split //, shift;
for (my $x = $#in; $x >= 0; $x--) { print $in[$x]; }
print "\n";
},
'as_html' => sub {
my $in = shift;
$in =~ s/\n/\
/g;
print '' .
'' .
'