]> git.vpit.fr Git - perl/modules/re-engine-Plugin.git/blob - t/Example.pm
Importing re-engine-Plugin-0.02.tar.gz
[perl/modules/re-engine-Plugin.git] / t / Example.pm
1 package Example;
2 use strict;
3
4 # Note the (), doesn't call ->import
5 use re::engine::Plugin ();
6
7 sub import {
8     # Populates %^H with re::engine::Plugin hooks
9     re::engine::Plugin->import(
10         exec => \&exec,
11     );
12 }
13
14 *unimport = \&re::engine::Plugin::unimport;
15
16 sub exec
17 {
18     my ($re, $str) = @_;
19
20     $re->num_captures(
21         FETCH => sub {
22             my ($re, $paren) = @_;
23
24             $str . "_" . $paren;
25         }
26     );
27
28     1;
29 }
30
31 1;