line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# This file is part of Perl-Types |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# This software is copyright (c) 2023 by Auto-Parallel Technologies, Inc. |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
# This is free software; you can redistribute it and/or modify it under |
7
|
|
|
|
|
|
|
# the same terms as the Perl 5 programming language system itself. |
8
|
|
|
|
|
|
|
# |
9
|
|
|
|
|
|
|
# [[[ HEADER ]]] |
10
|
|
|
|
|
|
|
# ABSTRACT: enable Perl data types |
11
|
|
|
|
|
|
|
package Perl::Types; |
12
|
1
|
|
|
1
|
|
233316
|
use strict; |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
28
|
|
13
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
97
|
|
14
|
|
|
|
|
|
|
our $VERSION = 0.005_000; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# [[[ INCLUDES ]]] |
17
|
|
|
|
|
|
|
# DEV NOTE: these essential modules should be included automatically by all Perl code; do so with EXPORTS below |
18
|
1
|
|
|
1
|
|
676
|
use English; # prefer more expressive $ARG over $_, etc; LMPC #23: Thou Shalt Not Use ... Punctuation Variables ... |
|
1
|
|
|
|
|
3921
|
|
|
1
|
|
|
|
|
5
|
|
19
|
1
|
|
|
1
|
|
432
|
use Carp; # prefer more expressive carp()/croak() over warn()/die(); LMPC #8: Thou Shalt ... Create Maintainable, Re-Grokkable Code ... |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
46
|
|
20
|
1
|
|
|
1
|
|
5
|
use Data::Dumper; # prefer more expressive Dumper() over print(); LMPC #4: Thou Shalt ... Create ... Bug-Free, High-Quality Code ... |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
45
|
|
21
|
|
|
|
|
|
|
$Data::Dumper::Sortkeys = 1; # sort hash keys |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# DEV NOTE: when you include Perl::Types, you also include the modules above via the exports below |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
# [[[ EXPORTS ]]] |
26
|
|
|
|
|
|
|
# DEV NOTE: do not export individual variables such as $ARG or @ARG, causes unexplainable errors such as incorrect subroutine arguments; |
27
|
|
|
|
|
|
|
# export subroutines and typeglobs only; |
28
|
|
|
|
|
|
|
# "Exporting variables is not a good idea. They can change under the hood, provoking horrible effects at-a-distance that are too hard to track and to fix. Trust me: they are not worth it." https://perldoc.perl.org/Exporter#What-Not-to-Export |
29
|
1
|
|
|
1
|
|
5
|
use Exporter qw(import); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
173
|
|
30
|
|
|
|
|
|
|
our @EXPORT = (@English::EXPORT, @Carp::EXPORT, @Data::Dumper::EXPORT); # export all symbols imported from essential modules |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
# NEED ANSWER: do we need to change @LAST_MATCH_START and @LAST_MATCH_END, exported by English, to be typeglobs instead of array variables? |
33
|
|
|
|
|
|
|
# NEED ANSWER: do we need to change @LAST_MATCH_START and @LAST_MATCH_END, exported by English, to be typeglobs instead of array variables? |
34
|
|
|
|
|
|
|
# NEED ANSWER: do we need to change @LAST_MATCH_START and @LAST_MATCH_END, exported by English, to be typeglobs instead of array variables? |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
#print 'in Perl::Types, have @English::EXPORT = ', Dumper(\@English::EXPORT), "\n"; |
37
|
|
|
|
|
|
|
#die 'TMP DEBUG'; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
# START HERE: refactor out all of these types into their own .pm files, continue with long-term Perl types refactoring project |
42
|
|
|
|
|
|
|
# START HERE: refactor out all of these types into their own .pm files, continue with long-term Perl types refactoring project |
43
|
|
|
|
|
|
|
# START HERE: refactor out all of these types into their own .pm files, continue with long-term Perl types refactoring project |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
# [[[ DATA TYPES ]]] |
46
|
|
|
|
|
|
|
package void; 1; |
47
|
|
|
|
|
|
|
package boolean; 1; |
48
|
|
|
|
|
|
|
package integer; 1; |
49
|
|
|
|
|
|
|
package number; 1; |
50
|
|
|
|
|
|
|
package character; 1; |
51
|
|
|
|
|
|
|
package string; 1; |
52
|
|
|
|
|
|
|
package arrayref; 1; |
53
|
|
|
|
|
|
|
package hashref; 1; |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
package string::arrayref; 1; |
56
|
|
|
|
|
|
|
package string::hashref; 1; |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
package hashref::arrayref; 1; |
59
|
|
|
|
|
|
|
package hashref::hashref; 1; |
60
|
|
|
|
|
|
|
package hashref::hashref::hashref; 1; |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
package string::hashref::arrayref; 1; |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
package filehandleref; 1; |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
package Perl::Types; |
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
1; |