Initial data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 72d218235f
commit f23f22d71c
199087 changed files with 3378941 additions and 0 deletions

View file

@ -0,0 +1,31 @@
#!/usr/bin/env perl
use 5.010_000;
# Sort strings
my $x = 'lions, tigers, and';
my $y = 'bears, oh my!';
my $z = '(from the "Wizard of OZ")';
# When assigning a list to list, the values are mapped
( $x, $y, $z ) = sort ( $x, $y, $z );
say 'Case 1:';
say " x = $x";
say " y = $y";
say " z = $z";
# Sort numbers
$x = 77444;
$y = -12;
$z = 0;
# The sort function can take a customizing block parameter.
# The spaceship operator creates a by-value numeric sort
( $x, $y, $z ) = sort { $a <=> $b } ( $x, $y, $z );
say 'Case 2:';
say " x = $x";
say " y = $y";
say " z = $z";