| Server IP : 23.254.227.96 / Your IP : 216.73.216.183 Web Server : Apache/2.4.62 (Unix) OpenSSL/1.1.1k System : Linux hwsrv-1277026.hostwindsdns.com 4.18.0-477.13.1.el8_8.x86_64 #1 SMP Tue May 30 14:53:41 EDT 2023 x86_64 User : viralblo ( 1001) PHP Version : 8.1.31 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /proc/self/root/usr/share/doc/perl-Sub-Exporter/t/lib/Test/SubExporter/ |
Upload File : |
#!/usr/bin/perl
package Test::SubExporter::GroupGen;
use strict;
use warnings;
use Sub::Exporter;
my $alfa = sub { 'alfa' };
my $bravo = sub { 'bravo' };
my $returner = sub {
my ($class, $group, $arg, $collection) = @_;
my %given = (
class => $class,
group => $group,
arg => $arg,
collection => $collection,
);
return {
foo => sub { return { name => 'foo', %given }; },
bar => sub { return { name => 'bar', %given }; },
};
};
sub gen_group_by_name {
my ($class, $group, $arg, $collection) = @_;
my %given = (
class => $class,
group => $group,
arg => $arg,
collection => $collection,
);
return {
baz => sub { return { name => 'baz', %given }; },
};
}
my $config = {
exports => [ ],
groups => {
alphabet => sub { { a => $alfa, b => $bravo } },
generated => $returner,
# symbolic => \&gen_group_by_name,
# symbolic => sub { shift->gen_group_by_name(@_) },
symbolic => \'gen_group_by_name',
},
collectors => [ 'col1' ],
};
Sub::Exporter::setup_exporter($config);
"gg";