in reply to Subroutine Reference with use strict

chiller, what's the purpose of the (@)s in your code?

Try:

%states = ( 'Default' => \&front_page, 'Lost' => \&lost, );
as you are generating coderefs for sub front_page and sub lost. See perldoc perlsub for more about coderefs.

Replies are listed 'Best First'.
Re: Re: Subroutine Reference with use strict
by chiller (Scribe) on Apr 13, 2002 at 20:44 UTC
    The purposes of the prototypes in the refs is to avoid this particular error, unless you can find another way around it:
    Prototype mismatch: sub Apache::ROOT::myPackage::::lost vs (@) at (eva +l 72) line 478 (#5)
    Obviously it isn't supposed to work that way, and putting the prototypes in there was just kind of a shot in the dark. But that particular error went away :)