in reply to probably stupid mistake
The other monks have given you great advice but you might also look in to using the graphical Perl debugger PTKDB
To disagree, one doesn't have to be disagreeable - Barry Goldwater
Using that has solved numerous problems I've had since you can step through the code and watch what's happening with your variables and how they change.
To disagree, one doesn't have to be disagreeable - Barry Goldwater
In Section
Seekers of Perl Wisdom