From 565442655f6fde476dd3822f2b66f6f34ad418bb Mon Sep 17 00:00:00 2001 From: dakkar Date: Wed, 17 Feb 2010 23:08:06 +0000 Subject: don't call parsers on not-found files --- lib/File/Cache/Parsed.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/File/Cache/Parsed.pm b/lib/File/Cache/Parsed.pm index a8a8e2e..57426b6 100644 --- a/lib/File/Cache/Parsed.pm +++ b/lib/File/Cache/Parsed.pm @@ -85,6 +85,8 @@ sub get { my $contents=try {file($filename)->slurp} catch {return}; + return unless defined $contents; + my $pp=first {$filename =~ m{$_->[0]}} @{$self->{parsers}}; if ($pp) { return $self->{cache}{$filename}=$pp->[1]->($filename,$contents); -- cgit v1.2.3