~ubuntu-branches/ubuntu/utopic/libconfig-any-perl/utopic

« back to all changes in this revision

Viewing changes to lib/Config/Any/Perl.pm

  • Committer: Bazaar Package Importer
  • Author(s): Salvatore Bonaccorso
  • Date: 2010-02-16 11:17:45 UTC
  • mfrom: (1.1.9 upstream) (2.1.7 sid)
  • Revision ID: james.westby@ubuntu.com-20100216111745-nw1ats85x8tmzhlp
Tags: 0.19-1
* New upstream release
* Add myself to Uploaders. 
* Referesh debian/copyright and update Copyright years. 
* Bump Standards-Version to 3.8.4 (no changes). 

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 
6
6
use base 'Config::Any::Base';
7
7
 
8
 
my %cache;
9
 
 
10
8
=head1 NAME
11
9
 
12
10
Config::Any::Perl - Load Perl config files
46
44
sub load {
47
45
    my $class = shift;
48
46
    my $file  = shift;
49
 
    my $content;
50
47
 
51
 
    unless ( $content = $cache{ $file } ) {
52
 
        $content = require $file;
53
 
        $cache{ $file } = $content;
 
48
    my( $exception, $content );
 
49
    {
 
50
        local $@;
 
51
        $content = do $file;
 
52
        $exception = $@;
54
53
    }
 
54
    die $exception if $exception;
55
55
 
56
56
    return $content;
57
57
}
62
62
 
63
63
=head1 COPYRIGHT AND LICENSE
64
64
 
65
 
Copyright 2006-2009 by Brian Cassidy
 
65
Copyright 2006-2010 by Brian Cassidy
66
66
 
67
67
This library is free software; you can redistribute it and/or modify
68
68
it under the same terms as Perl itself.