Hana 9e216da9ef go.mod: add go.mod and move pygments to third_party
After go1.16, go will use module mode by default,
even when the repository is checked out under GOPATH
or in a one-off directory. Add go.mod, go.sum to keep
this repo buildable without opting out of the module
mode.

> go mod init github.com/mmcgrana/gobyexample
> go mod tidy
> go mod vendor

In module mode, the 'vendor' directory is special
and its contents will be actively maintained by the
go command. pygments aren't the dependency the go will
know about, so it will delete the contents from vendor
directory. Move it to `third_party` directory now.

And, vendor the blackfriday package.

Note: the tutorial contents are not affected by the
change in go1.16 because all the examples in this
tutorial ask users to run the go command with the
explicit list of files to be compiled (e.g.
`go run hello-world.go` or `go build command-line-arguments.go`).
When the source list is provided, the go command does
not have to compute the build list and whether it's
running in GOPATH mode or module mode becomes irrelevant.
2021-02-15 16:45:26 -05:00

63 lines
1.2 KiB
Perl

#!/usr/bin/perl
# from http://gist.github.com/485595
use strict;
use warnings;
use Time::HiRes 'usleep';
for (1..5) {
open my $in, '<', '/proc/sys/kernel/random/entropy_avail' or die;
print <$in>;
close $in;
usleep 100_000;
}
# other miscellaneous tests of numbers separated by _
#usleep 100_000;
100_000_000;
my $nichts = 0.005_006;
print "$nichts\n";
my $nichts2 = 0.005_006_007;
print 900_800_700.005_006_007, $/;
# numbers from `man 1 perlnumber`
my $n;
$n = 1234; # decimal integer
$n = 0b1110011; # binary integer
$n = 01234; # octal integer
$n = 0x1234; # hexadecimal integer
$n = 12.34e-56; # exponential notation
$n = "-12.34e56"; # number specified as a string
$n = "1234"; # number specified as a string
# other numbers
for (
-9876,
+8765,
-9876.02,
-9876.02e+10,
+765_432e30,
2002.,
.2002,
) {
print $_, "\n";
}
# operators on numbers
for (
$n + 300,
$n - 300,
$n / 300 + 10,
$n * 250 / 2.0,
$n == 100,
$n != 100,
$n > 100,
$n >= 100,
$n < 100,
$n <= 100,
$n % 2,
abs $n,
) {
print $_, "\n";
}