Skip to content

Instantly share code, notes, and snippets.

@paveljurca
Last active August 29, 2015 14:14
Show Gist options
  • Save paveljurca/19a1e008250018b98b5c to your computer and use it in GitHub Desktop.
Save paveljurca/19a1e008250018b98b5c to your computer and use it in GitHub Desktop.
have a Perl diary!
#!/usr/bin/env perl
use strict;
use autodie;
my $note = \&diary;
sub diary {
my %tasks;
chomp(my($date,$task) = @_);
$tasks{$date} = $task;
### add FILEHANDLE, have a file!
#open(my $fh, '>>', q|diary.txt|);
#select $fh;$|=1; #flush buffer
#print $fh "debug";
###
print "$_: $tasks{$_}\n"
for (sort keys %tasks);
}
"1/28/2015"->$note("make a gist");
"1/29/2015"->$note("talk to somebody real");
#<STDIN>->$note(scalar <STDIN>);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment