-
Notifications
You must be signed in to change notification settings - Fork 34
/
program_00_good.pl
executable file
·66 lines (51 loc) · 2.38 KB
/
program_00_good.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/usr/bin/env perl
# [[[ PREPROCESSOR ]]]
# <<< EXECUTE_SUCCESS: "have $foo_integer = 9_123" >>>
# <<< EXECUTE_SUCCESS: "have $foo_number = 9_123.45" >>>
# <<< EXECUTE_SUCCESS: "have $foo_string = howdy" >>>
# <<< EXECUTE_SUCCESS: "have $aaa_boolean = 0" >>>
# <<< EXECUTE_SUCCESS: "have $bbb_boolean = 0" >>>
# <<< EXECUTE_SUCCESS: "have $ccc_boolean = 0" >>>
# <<< EXECUTE_SUCCESS: "have $ddd_boolean = 1" >>>
# <<< EXECUTE_SUCCESS: "have $aaa_integer = 9_123" >>>
# <<< EXECUTE_SUCCESS: "have $bbb_integer = 22" >>>
# <<< EXECUTE_SUCCESS: "have $aaa_number = 9_123.45" >>>
# <<< EXECUTE_SUCCESS: "have $bbb_number = -22.3" >>>
# <<< EXECUTE_SUCCESS: "have $aaa_string = howdy" >>>
# <<< EXECUTE_SUCCESS: "have $bbb_string = doody" >>>
# [[[ HEADER ]]]
use RPerl;
use strict;
use warnings;
our $VERSION = 0.001_000;
# [[[ CRITICS ]]]
## no critic qw(ProhibitUselessNoCritic ProhibitMagicNumbers RequireCheckedSyscalls) # USER DEFAULT 1: allow numeric values & print operator
## no critic qw(RequireInterpolationOfMetachars) # USER DEFAULT 2: allow single-quoted control characters & sigils
# [[[ OPERATIONS ]]]
my integer $foo_integer = 9_123;
my number $foo_number = 9_123.456_789;
my string $foo_string = 'howdy';
print 'have $foo_integer = ', integer_to_string($foo_integer), "\n";
print 'have $foo_number = ', number_to_string($foo_number), "\n";
print 'have $foo_string = ', $foo_string, "\n";
print "\n";
my boolean $aaa_boolean = 0 && 0;
my boolean $bbb_boolean = 0 && 1;
my boolean $ccc_boolean = 1 && 0;
my boolean $ddd_boolean = 1 && 1;
my integer $aaa_integer = 22 && $foo_integer;
my integer $bbb_integer = $foo_integer && 22;
my number $aaa_number = -22.3 && $foo_number;
my number $bbb_number = $foo_number && -22.3;
my string $aaa_string = 'doody' && $foo_string;
my string $bbb_string = $foo_string && 'doody';
print 'have $aaa_boolean = ', $aaa_boolean, "\n";
print 'have $bbb_boolean = ', $bbb_boolean, "\n";
print 'have $ccc_boolean = ', $ccc_boolean, "\n";
print 'have $ddd_boolean = ', $ddd_boolean, "\n";
print 'have $aaa_integer = ', integer_to_string($aaa_integer), "\n";
print 'have $bbb_integer = ', integer_to_string($bbb_integer), "\n";
print 'have $aaa_number = ', number_to_string($aaa_number), "\n";
print 'have $bbb_number = ', number_to_string($bbb_number), "\n";
print 'have $aaa_string = ', $aaa_string, "\n";
print 'have $bbb_string = ', $bbb_string, "\n";