in reply to return if 0
My response is not really related to the question, but to the sample code.
In fact my response is nearly identical to this one I posted a while ago: Re: Delete files with Perl in Windows
In short: don't use &foo to call a subroutine, unless you really mean it. See the linked node for more info.
BTW, keep experimenting and asking questions. It's a great way to learn.
TGI says moo
In Section
Seekers of Perl Wisdom