in reply to Re: Re: Reducing repetitive code
in thread Reducing repetitive code

dragonchilds' concerns are quite valid, and easily handled while keeping to a simple array:
if ( $realmonth >0 and $realmonth <=12 ) { print $monthname[$realmonth-1]; } else { warn "Invalid value for realmonth: $realmonth\n"; }