This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use Modern::Perl '2014'; | |
my $hour = (localtime)[2]; | |
my $TOD = do { if($hour < 12) { "morning"} | |
elsif($hour < 17) { "afternoon"} | |
else { "evening"}}; | |
say $TOD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a hash | |
my %hashOfArraysOfHashs = ( key1 => [ { innerKey1 => 'is me', innerKey2 => 'is me' }, | |
{ innerKey1 => 'is me', innerKey2 => 'is me' }], | |
key2 => [ { innerKey1 => 'is me', innerKey2 => 'is me' }, | |
{ innerKey1 => 'is me', innerKey2 => 'is me' }, | |
{ innerKey1 => 'is me', innerKey2 => 'is me' }]); | |
# This is a hashref | |
my $hashOfArraysOfHashs = { key1 => [ { innerKey1 => 'is me', innerKey2 => 'is me' }, | |
{ innerKey1 => 'is me', innerKey2 => 'is me' }], | |
key2 => [ { innerKey1 => 'is me', innerKey2 => 'is me' }, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static int (**hget(int (**t)[2], int k))[2] { | |
int (**t2)[2] = t; | |
for (int h = k & (SIZE - 1); **t2 && ***t2 != k; h = (h + 1) & (SIZE - 1), t2 = t + h); | |
return t2; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use v5.10; use strict; use warnings; | |
my %counts; | |
for my $line (<>) { | |
my $path = (split /\?/, (split / /, $line)[2])[0]; | |
$counts{$path}++ | |
} |