]> iEval git - gruntmaster-data.git/commitdiff
Name subs with Sub::Name
authorMarius Gavrilescu <marius@ieval.ro>
Sat, 1 Feb 2014 12:32:47 +0000 (14:32 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Sat, 1 Feb 2014 12:32:47 +0000 (14:32 +0200)
Makefile.PL
lib/Gruntmaster/Data.pm

index 068bbb99eb9e777338d0ddb39a940f6c7bc88dfa..4ae4ad69a71c551d47f2a76c9311bccb2d7b5e29 100644 (file)
@@ -20,6 +20,7 @@ WriteMakefile(
                   IO::Prompter 0
                   JSON 0
                   Redis 0
+                  Sub::Name 0
                   Term::ANSIColor 0/,
        },
        META_MERGE        => {
index 1b2492cc28c6a07dc927edf30d4039ec9fe1e1eb..a90149aea9097e00625338c73953d0d6908372fa 100644 (file)
@@ -4,16 +4,17 @@ use warnings;
 use parent qw/Exporter/;
 
 use JSON qw/encode_json decode_json/;
-
 use Redis;
+use Sub::Name qw/subname/;
 
 our $contest;
 my $redis = Redis->new;
 my $pubsub = Redis->new;
 
 sub dynsub{
+       our ($name, $sub) = @_;
        no strict 'refs';
-       *{$_[0]} = $_[1];
+       *$name = subname $name => $sub
 }
 
 BEGIN {
This page took 0.026669 seconds and 4 git commands to generate.