[dancer-users] CODE in export_symbols_to
Hao Wu
echowuhao at gmail.com
Sun Mar 17 20:17:21 GMT 2013
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 at 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 }
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20130317/03970e54/attachment.htm>
More information about the dancer-users
mailing list