#!/usr/bin/perl -w use warnings; my $text; my @a = ( sub {$text = $_[0]}, # Assign text to $1 sub {$text = $_[0] . $text}, # Prepend text with $1 sub {$text .= "\n"; shift}, # Appends "\n" to text sub {$text =~ s/$_[1]//; print $text} # Remove $1 from text, print text ); sub AUTOLOAD { *{$AUTOLOAD} = shift(@a); goto &$AUTOLOAD } foreach my $subname (v74, "put", "the", "RAPH") { *{$subname.'::AUTOLOAD'} = \&{'AUTOLOAD'} } I put the J in RAPH and remove the R