Hi Dancers, I am reading the dancer2 code and can not figure out what the CODE means here. Could anyone give me some direction? Thanks. Dancer2/Core/Role/DSL.pm 44 sub export_symbols_to { 45 my ($self, $caller, $args) = @_; 46 my $exports = $self->_construct_export_map($args); 47 48 foreach my $export (keys %{$exports}) { 49 no strict 'refs'; 50 my $existing = *{"${caller}::${export}"}{CODE}; 51 52 next if defined $existing; 53 54 *{"${caller}::${export}"} = $exports->{$export}; 55 } 56 57 return keys %{$exports}; 58 }
I figure it out now. Really learn a lot by reading the codes. Thanks. On Sun, Mar 17, 2013 at 11:13 AM, Hao Wu <echowuhao@gmail.com> wrote:
Hi Dancers,
I am reading the dancer2 code and can not figure out what the CODE means here. Could anyone give me some direction? Thanks.
Dancer2/Core/Role/DSL.pm
44 sub export_symbols_to { 45 my ($self, $caller, $args) = @_; 46 my $exports = $self->_construct_export_map($args); 47 48 foreach my $export (keys %{$exports}) { 49 no strict 'refs'; 50 my $existing = *{"${caller}::${export}"}{CODE}; 51 52 next if defined $existing; 53 54 *{"${caller}::${export}"} = $exports->{$export}; 55 } 56 57 return keys %{$exports}; 58 }
participants (1)
-
Hao Wu