This file contains hidden or 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
#!/opt/perl/current/bin/perl | |
use v5.14; | |
use utf8; | |
use strict; | |
use warnings; | |
use AnyEvent; | |
use AnyEvent::HTTP; | |
use AnyEvent::IRC::Client; | |
use AnyEvent::IRC::Util qw< rfc_code_to_name >; |
This file contains hidden or 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/perl | |
use utf8; | |
use strict; | |
use warnings; | |
no warnings qw< void >; | |
use Getopt::Long; | |
$::PROGRAM = "incoming-sms-handler"; | |
$::VERSION = "0.1.5"; |
This file contains hidden or 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/perl | |
use v5.10; | |
use strict; | |
use warnings; | |
use Data::Dump qw< dd pp >; | |
use JSON::XS; | |
use LWP::Simple; | |
use URI::Escape; |
This file contains hidden or 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
sub coerce_types { | |
my $struct = shift; | |
my $ref = ref $struct; | |
croak "can only work with references" unless $ref; | |
if ($ref eq "ARRAY") { | |
for my $i (0..$#{$struct}) { | |
next unless defined $struct->[$i]; |
This file contains hidden or 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
use strict; | |
use constant_tiny; | |
use constant pi => 4 * atan2(1, 1); | |
use constant ponies => qw< | |
Twilight_Sparkle Fluttershy Pinkie_Pie AppleJack Rainbow_Dash Rarity | |
>; | |
use constant { |
This file contains hidden or 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/perl | |
use strict; | |
use Email::Folder; | |
use Email::LocalDelivery::Maildir; | |
my ($mbox, $mdir) = @ARGV; | |
Email::LocalDelivery::Maildir->deliver( $_, $mdir ) | |
for Email::Folder->new($mbox)->messages; |