Created
November 22, 2011 18:17
-
-
Save jyotty/1386420 to your computer and use it in GitHub Desktop.
I can't speak for what I was thinking at the time.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (!grep { $action eq $_ } @Controller::actions) { | |
| unshift(@parts, $action, 404); | |
| $action = 'error'; | |
| } | |
| # … | |
| my $sub; | |
| { | |
| no strict 'refs'; | |
| $sub = *{"Controller::$action"}{CODE}; | |
| } | |
| #… | |
| package Controller; | |
| our @actions = do { | |
| no strict 'refs'; | |
| grep { exists &{$_} && !/^_/ } keys %{__PACKAGE__.'::'}; | |
| }; | |
| sub error { … } # &c |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment