sub loadCode { my $this = shift; my $scrref = &getFileAsString($this->{filename}); # load into the registry $this->{code} = sub {eval($$scrref);}; # store the script in an anonymous subroutine }