in reply to File Indexing program
Have you used strict and warnings?
At a first look I see two potentially fatal problems here:
The use of local @current instead of my @current could work fine, but should be avoided and I'm not sure what can it do in a (deeply) recursive function.
The same applies to $temp and @mainarray, but this is not fatal as the first is not reused after recursion and the latter is intended to be a global. But it is anyway bad practice.
Bottom line: strict&warnings are your friends, (almost) always.
$i is not declared lexical (my) but is a global, so every recursion corrupts the value of $i of the previous and pending executions
Rule One: "Do not act incautiously when confronting a little bald wrinkly smiling man."
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: File Indexing program
by chetanspecial (Initiate) on Jun 24, 2008 at 19:30 UTC | |
by psini (Deacon) on Jun 24, 2008 at 19:43 UTC |