in reply to recursive. again.

When I download and try to run your code, I get a compile error on this line:
push @array, yx;

Replies are listed 'Best First'.
Re^2: recursive. again.
by derpp (Acolyte) on Aug 24, 2010 at 00:13 UTC
    ah, oops. Fixed it, and tried to run again. Guess it wasn't the problem.
      Good. Now to the next problem. When I pass your program the value 5, I get a warning message on this line:
      print $array[ $i - 1 ];

      I'm pretty sure $i is initialized. What about the array? Let's check:

      use Data::Dumper; print Dumper(\@array);

      Nope. The array is empty. That's because you never call the number function, as AnonyMonk already pointed out.

        Sorry, I'm kind of a beginner, so I'm not really sure. What I should do is call the number function at  print $array[$i-1], right? Or should I do that before I push anything in there?