App-FTNDB
view release on metacpan or search on metacpan
lib/App/FTNDB/Nodelist.pm view on Meta::CPAN
sub nodelist_file_info {
my $nodelist_file = shift;
my (%info, $nl);
use File::Basename;
( $info{'FileName'}, $info{'FileDir'}, $info{'FileSuffix'} ) = fileparse($nodelist_file, qr/[^.]*/);
use File::stat;
my $fs = stat($nodelist_file);
# year of the converted timestamp is the fifth item
$info{'FileYear'} = (localtime($fs->mtime))[5] + 1900;
# yday of converted timestamp is the seventh item
$info{'FileYDay'} = (localtime($fs->mtime))[7] + 1;
# Read in the first line of the nodelist file.
open $nl, q{<}, $nodelist_file or croak "Cannot open $nodelist_file";
$info{'HeaderLine'} = <$nl>;
close $nl;
( run in 0.514 second using v1.01-cache-2.11-cpan-49f99fa48dc )