comparison Lib/IMPL/require.pm @ 205:891c04080658

IMPL::Web::View fixed template selection, release candidate
author sergey
date Thu, 03 May 2012 01:00:02 +0400
parents 6b1dda998839
children 6d8092d8ce1b
comparison
equal deleted inserted replaced
204:d63f9a92d6d4 205:891c04080658
1 package IMPL::require; 1 package IMPL::require;
2 use Scalar::Util qw(set_prototype); 2 use Scalar::Util qw(set_prototype);
3 use strict;
3 4
4 sub import { 5 sub import {
5 my ($self, $aliases) = @_; 6 my ($self, $aliases) = @_;
6 7
7 return unless $aliases; 8 return unless $aliases;
8 9
9 die "A hash reference is required" unless ref $aliases eq 'HASH'; 10 die "A hash reference is required" unless ref $aliases eq 'HASH';
10 11
11 my $caller = $caller; 12 my $caller = caller;
12 13
13 no strict 'refs'; 14 no strict 'refs';
14 15
15 while( my ($alias, $class) = each %$aliases ) { 16 while( my ($alias, $class) = each %$aliases ) {
16 (my $file = $class) =~ s/::|'/\//g; 17 (my $file = $class) =~ s/::|'/\//g;