#!/usr/bin/env perl use 5.010; use strict; use warnings; my %table = ( uppercase => sub { uc $_[0] }, lowercase => sub { lc $_[0] }, mixedcase => sub { ucfirst lc $_[0] }, ); say $table{"uppercase"}->("Foo"); say $table{"lowercase"}->("Bar"); say $table{"mixedcase"}->("Baz");