~ubuntu-branches/ubuntu/feisty/libtemplate-plugin-class-perl/feisty

« back to all changes in this revision

Viewing changes to lib/Template/Plugin/Class.pm

  • Committer: Bazaar Package Importer
  • Author(s): Krzysztof Krzyzaniak (eloy)
  • Date: 2006-11-23 13:43:36 UTC
  • mfrom: (2.1.2 edgy)
  • Revision ID: james.westby@ubuntu.com-20061123134336-452xb2pp1dbhgyui
Tags: 0.13-2
* Adopted for Debian Perl Group
* debian/control: debhelper (>= 5)
* debian/compat: increased to 5

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
package Template::Plugin::Class;
3
3
use base 'Template::Plugin';
4
4
use vars qw( $VERSION );
5
 
$VERSION = '0.12';
 
5
$VERSION = '0.13';
6
6
 
7
7
sub new {
8
8
    my $class = shift;
13
13
    eval "require $arg";
14
14
    # Only ignore "Can't locate" errors from our eval require.
15
15
    # Other fatal errors (syntax etc) must be reported.
16
 
    die if $@ && $@ !~ /^Can't locate .*? at \(eval /;
 
16
    (my $filename = $arg) =~ s!::!/!g;
 
17
    die if $@ && $@ !~ /Can't locate \Q$filename\E\.pm/;
17
18
    no strict 'refs';
18
19
    unless (%{"$arg\::"}) {
19
20
        require Carp;
68
69
=head1 BUGS
69
70
 
70
71
Apart from the mentioned caveat, none currently known.  If you find
71
 
any please make use of L<http://rt.cpan.org> by mailing your report to
72
 
bug-Template-Plugin-Class@rt.cpan.org, or contact me directly.
 
72
any please contact the author.
73
73
 
74
74
=head1 AUTHOR
75
75
 
77
77
 
78
78
=head1 COPYRIGHT
79
79
 
80
 
Copyright (C) 2003 Richard Clamp.  All Rights Reserved.
 
80
Copyright (C) 2003, 2004, 2006 Richard Clamp.  All Rights Reserved.
81
81
 
82
82
This module is free software; you can redistribute it and/or modify it
83
83
under the same terms as Perl itself.