my @msg; $msg[0] = 'Wrong input.'; # Doesn't say much but it's just an example $msg[1] = 'Thanks for signing up with us!'; $msg[2] = 'Go away, hacker.'; # Example of use... sub check_input { #blah blah... msg($[2]); } sub msg { my $msg = shift; start_html("Message"), print p("$msg"); end_html(); }