Server IP : 51.89.169.208 / Your IP : 3.139.95.77 Web Server : Apache System : Linux ns3209505.ip-198-244-202.eu 4.18.0-553.27.1.el8_10.x86_64 #1 SMP Tue Nov 5 04:50:16 EST 2024 x86_64 User : yellowleaf ( 1019) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | 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";