my $msgs = { '200' => 'OK', '400' => 'Bad Request', '403' => 'Forbidden', '404' => 'Not Found', '500' => 'Internal Sever Error', }; sub msg { print "HTTP/1.0 $_[0] $msgs->{$_[0]}\n"; } if (1 == 1) { msg(400); }