perl function testing