Created
July 21, 2011 21:43
-
-
Save djanatyn/1098291 to your computer and use it in GitHub Desktop.
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/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