diff options
author | dakkar <dakkar@luxion> | 2008-01-02 21:20:15 +0000 |
---|---|---|
committer | dakkar <dakkar@luxion> | 2008-01-02 21:20:15 +0000 |
commit | d0d6cd4b581cb016493401e190e5b813218816e5 (patch) | |
tree | 3e1d909fd3da973cf82517a973991b8a80e8cdab /lib/File/Cache/Parsed.pm | |
parent | ugly way to get titles... may require double-run (diff) | |
download | WebCoso-d0d6cd4b581cb016493401e190e5b813218816e5.tar.gz WebCoso-d0d6cd4b581cb016493401e190e5b813218816e5.tar.bz2 WebCoso-d0d6cd4b581cb016493401e190e5b813218816e5.zip |
better handling of non-existing files, and a --clean option
git-svn-id: svn://luxion/repos/WebCoso/trunk@319 fcb26f47-9200-0410-b104-b98ab5b095f3
Diffstat (limited to 'lib/File/Cache/Parsed.pm')
-rw-r--r-- | lib/File/Cache/Parsed.pm | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/File/Cache/Parsed.pm b/lib/File/Cache/Parsed.pm index a3843d1..bc4036d 100644 --- a/lib/File/Cache/Parsed.pm +++ b/lib/File/Cache/Parsed.pm @@ -80,7 +80,9 @@ sub get { return $self->{cache}{$filename} if exists $self->{cache}{$filename}; - my $contents=file($filename)->slurp; + my $contents=eval {file($filename)->slurp}; + + return if $@; my $pp=first {$filename =~ m{$_->[0]}} @{$self->{parsers}}; if ($pp) { |