c:\@Work\Perl\monks>perl -wMstrict -le "use constant VALID_TAG => qr{ \A [[:alpha:]] [[:alpha:]\d]* \z }xms; ;; sub html (*@) { my ($tag, @strings) = @_; ;; $tag =~ s{ \A \s+ | \s+ \z}{}xmsg; die qq{invalid tag '$tag'} unless $tag =~ VALID_TAG; ;; return qq{<$tag>@strings}; } ;; print html(p, qw(how now brown cow)); my $n = 2; print html('h' . $n, 'the rain in spain'); print html(strike, 'now', html(b, 'is the'), 'time'); ;; print html(42, 'oops...'); "

how now brown cow

the rain in spain

now is the time invalid tag '42' at -e line 1.