> > sub card{
> >
> >   my %card_map;
> >   my ($num)=@_;
> >  @card_map{1..9}= qw(one two three four five six seven eight nine);
>
> You are putting the numbers 0..9 in the array @card_map here, not in
the
> hash %cardmap.

No he isn't. (He's using a hash slice, which is fine.)

I would think you are always getting 'one', right?

That's because:

    my ($num) = @_;

puts the length of @_ in $num.

You want:

    my ($num) = shift;

or

    my ($num) = @_[0];

hth.

Reply via email to