Skip Menu |

This queue is for tickets about the Dist-Zilla-Plugin-Extras CPAN distribution.

Report information
The Basics
Id: 105756
Status: resolved
Priority: 0/
Queue: Dist-Zilla-Plugin-Extras

People
Owner: Nobody in particular
Requestors: VDB [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: 0.03
Fixed in: (no value)



Subject: Non-optimal code sample in the doc
Hi, thanks for implementing my previous request. However, sample code in the documentation is working but not optimal: my $extras_plugin = grep { $_->plugin_name eq 'Extras' } $zilla->plugins; my $name1 = $extras_plugin->params->{name1}; # -> "value1" There is no need for grepping plugins, Dist-Zilla has convenient method plugin_named: my $extras_plugin = $zilla->plugin_named('Extras'); my $name1 = $extras_plugin->params->{name1}; # -> "value1"
On Wed Jul 08 15:30:20 2015, VDB wrote: Show quoted text
> Hi, thanks for implementing my previous request. > > However, sample code in the documentation is working but not optimal: > > my $extras_plugin = grep { $_->plugin_name eq 'Extras' } $zilla-
> >plugins;
> my $name1 = $extras_plugin->params->{name1}; # -> "value1" > > There is no need for grepping plugins, Dist-Zilla has convenient > method plugin_named: > > my $extras_plugin = $zilla->plugin_named('Extras'); > my $name1 = $extras_plugin->params->{name1}; # -> "value1"
Yup, I should've used plugin_named(), thanks. Updated in repo, but I haven't made a new release.