I'm also a perl newbie, but couldn't you use a hash? Something like:
%fullMonth = ( jan => January,
feb => February,
mar => March,
etc...);
print "Month: $fullMonth{$month}";
-eric
[EMAIL PROTECTED] wrote:
I'm trying to write a subroutine that returns the full month name, for
example January, or February when I call the subroutine and pass a
scalar, for example $m that could have a value in one of the following
format
1. three letter format, for example jan or feb, or
2. one or digit format for example "01" or "1" for january
Example:
sub returnFullmonth{
}
from the main program:
$month ="Feb";
#or $month = "02" or "2";
$fullMonth = &returnFullmonth($month);
print "Month: $fullMonth";
expected out put: Month: February
can some help me and tell me how to write the subroutine?
Many thanks in advance.
bbrecht
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/