Hi Members,
It seemed that a value was incorrectly retrieved from the hash list in the
following small Perl script. .
#!/usr/local/bin/perl
sub card{
my %card_map;
my ($num)=@_;
@card_map{1..9}= qw(one two three four five six seven eight nine);
if ($card_map{$num}) {
$card_map{$num};
} else {
$num;
}
}
while (<>) {
chomp;
print "card of $_ is:" &card($_), "\n";
}
The problem is when a numeric value is inputed, it can't get correct
correspondent English name. Any help is appreciated
- Re: Problem with hash value Wang, Lanbo
- Re: Problem with hash value M.W. Koskamp
- Re: Problem with hash value Me
- Re: Problem with hash value Michael Fowler
- Re: Problem with hash value Abdulaziz Ghuloum
- Re: Problem with hash value Michael Fowler
- Re: Problem with hash value Me
