-
Notifications
You must be signed in to change notification settings - Fork 34
/
program_00_good.pl
executable file
·32 lines (26 loc) · 1 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
#!/usr/bin/env perl
# [[[ 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 = 3;
my integer $bar = -3; # Literal Number, not Operator
my integer $bat = -(3); # Operator(Literal Number)
my integer $baz = 5 - -($bar);
print 'have $foo = ', $foo, "\n";
print 'have $bar = ', $bar, "\n";
print 'have $bat = ', $bat, "\n";
print 'have $baz = ', $baz, "\n";
$foo = -(-3); # Operator(Literal Number)
$bar = -( -(3) ); # Operator(Operator(Literal Number))
$bat = $foo + -($bar);
$baz = $foo - -($bar);
print 'have $foo = ', $foo, "\n";
print 'have $bar = ', $bar, "\n";
print 'have $bat = ', $bat, "\n";
print 'have $baz = ', $baz, "\n";