- or download this
{
my @card_map = qw(zero one two three four five six seven eight nin
+e);
...
$pre . ($card_map[$n] // $n);
}
}
- or download this
sub card {
state @card_map = qw(zero one two three four five six seven eight
+nine);
my ($n, $pre) = map { $_< 0 ? (-$_, 'minus ') : ($_, '') } shift;
$pre . ($card_map[$n] // $n);
}
- or download this
C:\temp>perl kg.pl
Initialization of state variables in list context currently forbidden
+at kg.pl l
ine 10, near "qw(zero one two three four five six seven eight nine);"
Execution of kg.pl aborted due to compilation errors.