Skip to content

Instantly share code, notes, and snippets.

@djanatyn
Created July 21, 2011 21:43
Show Gist options
  • Save djanatyn/1098291 to your computer and use it in GitHub Desktop.
Save djanatyn/1098291 to your computer and use it in GitHub Desktop.
#!/usr/bin/perl
use strict;
use warnings;
use v5.10;
use IO::File;
use autodie;
package Entry;
sub new {
my ($filename) = @_;
my $fh = IO::File->new($filename, 'r');
my $self = {
"title" => <$fh>,
"date" => <$fh>,
"tag" => <$fh>,
"text" => join('', <$fh>),
};
bless $self, 'Entry';
return $self;
}
package main;
my @filenames = glob './input/*';
for $file (@filenames) { $file = new Entry; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment