package SpecialHash; use Tie::Hash; @SpecialHash::ISA = qw/Tie::StdHash/; sub FETCH { $_[1] eq "FLIPPED" ? { reverse %{ $_[0] } } : $_[0]->{$_[1]}; } package main; tie my %hash, 'SpecialHash'; @hash{ qw/foo bar/ } = qw/baz quux/; use Data::Dumper; print Dumper $hash{FLIPPED};