>  while (<>) {
>    chomp;
>    print "card  of $_ is:" &card($_), "\n";
>  }
                        ----^

Add a comma (,) or a string cat (.) between the quote and the function :-)

Aziz,,,



On Fri, 29 Jun 2001 18:04:33 -0400, Wang, Lanbo said:

> 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
>  


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

Reply via email to