Mercurial > pub > Impl
diff Lib/Configuration.pm @ 49:16ada169ca75
migrating to the Eclipse IDE
author | wizard@linux-odin.local |
---|---|
date | Fri, 26 Feb 2010 10:49:21 +0300 |
parents | 03e58a454b20 |
children |
line wrap: on
line diff
--- a/Lib/Configuration.pm Fri Feb 26 01:43:42 2010 +0300 +++ b/Lib/Configuration.pm Fri Feb 26 10:49:21 2010 +0300 @@ -1,37 +1,37 @@ -package Configuration; -use strict; - -my $Configured = 0; - -sub import { - my ($class,$site) = @_; - - if ($site and $site ne $Configured) { - Configure($site); - $Configured = $site; - } elsif (not $site and not $Configured) { - $Configured = 1; - require Configuration::Global; - } -} - -our %virtualSite; - -sub Configure { - my $siteName = shift; - require Configuration::Global; - - while ( my ($pattern,$configSite) = each %virtualSite) { - next if not $siteName =~ $pattern; - if (ref $configSite eq 'CODE') { - $configSite->(); - } elsif (not ref $configSite and $configSite) { - require $configSite; - } - last; - } -} - - - -1; +package Configuration; +use strict; + +my $Configured = 0; + +sub import { + my ($class,$site) = @_; + + if ($site and $site ne $Configured) { + Configure($site); + $Configured = $site; + } elsif (not $site and not $Configured) { + $Configured = 1; + require Configuration::Global; + } +} + +our %virtualSite; + +sub Configure { + my $siteName = shift; + require Configuration::Global; + + while ( my ($pattern,$configSite) = each %virtualSite) { + next if not $siteName =~ $pattern; + if (ref $configSite eq 'CODE') { + $configSite->(); + } elsif (not ref $configSite and $configSite) { + require $configSite; + } + last; + } +} + + + +1;