1PPIx::Regexp::Util(3) User Contributed Perl DocumentationPPIx::Regexp::Util(3)
2
3
4

NAME

6       PPIx::Regexp::Util - Utility functions for PPIx::Regexp;
7

SYNOPSIS

9        use PPIx::Regexp::Util qw{ __instance };
10            .
11            .
12            .
13        __instance( $foo, 'Bar' )
14            or die '$foo is not a Bar';
15

DESCRIPTION

17       This module contains utility functions for PPIx::Regexp which it is
18       convenient to centralize.
19
20       Double-underscore subroutines are private to the "PPIx-Regexp" package.
21       Their documentation is provided for the author's convenience only, and
22       they are subject to change without notice. Caveat user.
23
24       This module exports nothing by default.
25

SUBROUTINES

27       This module can export the following subroutines:
28
29   is_ppi_regexp_element
30        is_ppi_regexp_element( $elem )
31          and print "$elem is a regexp of some sort\n";
32
33       This subroutine is public and supported.
34
35       This subroutine takes as its argument a PPI::Element. It returns a true
36       value if the argument represents a regular expression of some sort, and
37       a false value otherwise.
38
39   __instance
40        __instance( $foo, 'Bar' )
41            and print '$foo isa Bar', "\n";
42
43       This subroutine is private to the "PPIx-Regexp" package.
44
45       This subroutine returns true if its first argument is an instance of
46       the class specified by its second argument. Unlike "UNIVERSAL::isa",
47       the result is always false unless the first argument is a reference.
48
49   __is_ppi_regexp_element
50        __is_ppi_regexp_element( $elem )
51          and print "$elem is a regexp of some sort\n";
52
53       This subroutine is private to the "PPIx-Regexp" package.
54
55       This is a synonym for is_ppi_regexp_element(), and is deprecated in
56       favor of it. If called, it will complain via "Carp::cluck()" and then
57       "goto &is_ppi_regexp_element".
58
59   __ns_can
60       This subroutine is private to the "PPIx-Regexp" package.
61
62       This method is analogous to "can()", but returns a reference to the
63       code only if it is actually implemented by the invoking name space.
64
65   __to_ordinal_en
66       This subroutine is private to the "PPIx-Regexp" package.
67
68       This subroutine takes as its argument an integer and returns a string
69       representing its ordinal in English. For example
70
71        say __to_ordinal_en( 17 );
72        # 17th
73

SEE ALSO

75       Params::Util, which I recommend, but in the case of "PPIx::Regexp" I
76       did not want to introduce a dependency on an XS module when all I
77       really wanted was the function of that module's "_INSTANCE()"
78       subroutine.
79

SUPPORT

81       Support is by the author. Please file bug reports at
82       <https://rt.cpan.org/Public/Dist/Display.html?Name=PPIx-Regexp>,
83       <https://github.com/trwyant/perl-PPIx-Regexp/issues>, or in electronic
84       mail to the author.
85

AUTHOR

87       Thomas R. Wyant, III wyant at cpan dot org
88
90       Copyright (C) 2010-2021 by Thomas R. Wyant, III
91
92       This program is free software; you can redistribute it and/or modify it
93       under the same terms as Perl 5.10.0. For more details, see the full
94       text of the licenses in the directory LICENSES.
95
96       This program is distributed in the hope that it will be useful, but
97       without any warranty; without even the implied warranty of
98       merchantability or fitness for a particular purpose.
99
100
101
102perl v5.32.1                      2021-03-26             PPIx::Regexp::Util(3)
Impressum