#!/usr/bin/perl use strict; use warnings; use Sub::Identify; use Sub::Install; sub hello_world { my $from = shift || 'who?!'; return "Hello World from " . $from; } sub decorate_h1 { my $sub = shift; my $subname = Sub::Identify::sub_name( $sub ); Sub::Install::reinstall_sub({ code => sub { my @args = @_; return "

" . $sub->(@args) . "

" }, as => $subname, }); return; } decorate_h1(\&hello_world); print hello_world('Perl!'), "\n";