2 # -----------------------------------------------------------------------------
3 package POE::Component::IRC::Plugin::NoPaste::StaticFile;
9 our @ISA = qw(Exporter);
10 our @EXPORT = qw(&static_file);
12 # path => [lastmod, content]
19 foreach my $inc (@INC) {
20 my $fpath = File::Spec->canonpath(
22 File::Spec->splitdir($inc),
23 qw(POE Component IRC Plugin NoPaste),
24 File::Spec->splitdir($path)));
31 defined $fullpath or return undef;
33 my $lastmod = stat($fullpath)->mtime;
35 my $entry = $TABLE->{$fullpath};
36 if (!$entry or $entry->[0] < $lastmod) {
38 open my $fh, '<', $fullpath;
42 $entry = $TABLE->{$fullpath} = [$lastmod, $content];