http://www.perlmonks.org?node_id=715164


in reply to Passing reference to subroutine

Try to make a habit of using strict and warnigs in all of your perl scripts. That would have revealed the out of scope error that Narveson has told you about.

use strict; use warnings;