Your question has been answered, but I'd like to make another comment. Please do not use prototypes. It's clear from the code that you don't know how Perl requires them to be presented for them to operate properly.
A function with a prototype must be declared or defined prior to the function being called. In addition, a function that calls itself must be declared before it is defined, if it is to have a prototype. When calling the function, the prototype is ignored if you preface the function call with an ampersand. You've violated two of those rules; your prototype is wasted.
There's also the grim fact that prototypes in Perl are far less useful than most programmers expect them to be, and they enforce often bizarre requirements on the arguments to functions -- some of these have been fixed only in the most recent versions of Perl.
Prototypes are deep magic, and even the best magicians get by without invoking them.
Are you posting in the right place? Check out Where do I post X? to know for sure.
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
Want more info? How to link or
or How to display code and escape characters
are good places to start.