The recursive return value for the
$c == 0 case in both code samples is not properly specified, so the return value is set to the value of the compared expression,
!$c in the first case, and
$c in the second. What you should have written was something like:
| | | perl -le 'sub a{my$c=pop;print $c;$c?$c*a($c-1):1}print a(--$ARGV[0])'
+ 5
|
MeowChow
s aamecha.s a..a\u$&owag.print