1PPIx::Regexp::Util(3) User Contributed Perl DocumentationPPIx::Regexp::Util(3)
2
3
4
6 PPIx::Regexp::Util - Utility functions for PPIx::Regexp;
7
9 use PPIx::Regexp::Util qw{ __instance };
10 .
11 .
12 .
13 __instance( $foo, 'Bar' )
14 or die '$foo is not a Bar';
15
17 This module contains utility functions for PPIx::Regexp which it is
18 convenient to centralize.
19
20 The contents of this module are private to the PPIx::Regexp package.
21 This documentation is provided for the author's convenience only.
22 Anything in this module is subject to change without notice. Caveat
23 user.
24
25 This module exports nothing by default.
26
28 This module can export the following subroutines:
29
30 __instance
31 __instance( $foo, 'Bar' )
32 and print '$foo isa Bar', "\n";
33
34 This subroutine returns true if its first argument is an instance of
35 the class specified by its second argument. Unlike "UNIVERSAL::isa",
36 the result is always false unless the first argument is a reference.
37
38 __is_ppi_regexp_element
39 __is_ppi_regexp_element( $elem )
40 and print "$elem is a regexp of some sort\n";
41
42 This subroutine takes as its argument a PPI::Element. It returns a true
43 value if the argument represents a regular expression of some sort, and
44 a false value otherwise.
45
46 __ns_can
47 This method is analogous to "can()", but returns a reference to the
48 code only if it is actually implemented by the invoking name space.
49
50 __to_ordinal_en
51 This subroutine takes as its argument an integer and returns a string
52 representing its ordinal in English. For example
53
54 say __to_ordinal_en( 17 );
55 # 17th
56
58 Params::Util, which I recommend, but in the case of "PPIx::Regexp" I
59 did not want to introduce a dependency on an XS module when all I
60 really wanted was the function of that module's "_INSTANCE()"
61 subroutine.
62
64 Support is by the author. Please file bug reports at
65 <http://rt.cpan.org>, or in electronic mail to the author.
66
68 Thomas R. Wyant, III wyant at cpan dot org
69
71 Copyright (C) 2010-2018 by Thomas R. Wyant, III
72
73 This program is free software; you can redistribute it and/or modify it
74 under the same terms as Perl 5.10.0. For more details, see the full
75 text of the licenses in the directory LICENSES.
76
77 This program is distributed in the hope that it will be useful, but
78 without any warranty; without even the implied warranty of
79 merchantability or fitness for a particular purpose.
80
81
82
83perl v5.28.0 2018-08-12 PPIx::Regexp::Util(3)