Skip to content

Instantly share code, notes, and snippets.

View davorg's full-sized avatar
💭
Perlin'

Dave Cross davorg

💭
Perlin'
View GitHub Profile
#!/usr/bin/perl
use strict;
use warnings;
use feature 'say';
use Storable;
my $hashref;
my $hash_file = 'hashfile';
#!/usr/bin/perl
use strict;
use warnings;
use 5.024;
package SVG::TrafficLight;
use Moose;
use SVG;
#!/usr/bin/perl
use strict;
use warnings;
use CGI qw/:standard/;
print header;
##
## property detail - shows a single property
@davorg
davorg / ages
Created February 1, 2016 15:35
Work out some ages in days
#!/usr/bin/perl
use strict;
use warnings;
use 5.010;
use Time::Piece;
use Time::Seconds;
use Lingua::EN::Inflexion;
On Wed, Dec 16, 2015 at 11:37:46AM +0000, Dave Cross <dave@perlhacks.com> wrote:
> Hi Marc,
>
> It seems that your blog post at
>
> http://blog.schmorp.de/2015-12-15-tidbits-cgipm-a-data-point.html
>
> jumped to some some conclusions that aren't backed up by the facts.
Dave, I am only reporting about that site, and the only newer version of
@davorg
davorg / gist:4321043ca6e926c5eb84
Created December 10, 2015 08:38
Overriding CORE::GLOBAL::open
#!/usr/bin/perl
use strict;
use warnings;
use 5.010;
BEGIN {
no strict 'refs';
use Symbol ();
use Devel::Peek;
#!/usr/bin/perl
use strict;
use warnings;
use 5.010;
my %letter;
@letter{'a' .. 'z'} = reverse 'a' .. 'z';
open my $word_fh, '<', '/usr/share/dict/words' or die $!;
### Keybase proof
I hereby claim:
* I am davorg on github.
* I am davorg (https://keybase.io/davorg) on keybase.
* I have a public key whose fingerprint is 4D8C A086 7A90 F3F0 AD97 F554 2A0F E00B D8E3 5D11
To claim this, I am signing this object:
@davorg
davorg / db.pl
Created August 28, 2014 08:49
Simple database query simulated with CSV files and hashes
#!/usr/bin/perl
use strict;
use warnings;
use 5.010;
my %data;
open my $fh2, '<', 'file2.txt' or die $!;
@davorg
davorg / hash_data
Created June 28, 2013 10:38
Add an MD5 hash to lines of data that have already been seen.
#!/usr/bin/perl
use strict;
use warnings;
use 5.010;
use Digest::MD5 'md5_hex';
my %seen;
while (<DATA>) {