my $regex = qr{^/=$}; my $coderef = sub { print $q->header('text/html'); # etc. }; GET( $regex, $coderef );