basic HTML tags
[catagits/Web-Simple.git] / lib / XML / Tags.pm
index f469070..480fefc 100644 (file)
@@ -3,6 +3,10 @@ package XML::Tags;
 use strict;
 use warnings FATAL => 'all';
 
+use File::Glob ();
+
+
+
 my $IN_SCOPE = 0;
 
 sub import {
@@ -12,6 +16,7 @@ sub import {
   my $opts = shift(@args) if ref($args[0]) eq 'HASH';
   my $target = $class->_find_target(0, $opts);
   my @tags = $class->_find_tags(@args);
+  $class->_setup_glob_override;
   my $unex = $class->_export_tags_into($target => @tags);
   $class->_install_unexporter($unex);
   $IN_SCOPE = 1;
@@ -36,7 +41,7 @@ sub _find_target {
     *CORE::GLOBAL::glob = sub {
       for ($_[0]) {
         # unless it smells like </foo> or <foo bar="baz">
-        return CORE::glob($_[0]) unless (/^\/\w+$/ || /^\w+\s+\w+="/);
+        return File::Glob::glob($_[0]) unless (/^\/\w+$/ || /^\w+\s+\w+="/);
       }
       return '<'.$_[0].'>';
     };
@@ -49,11 +54,6 @@ sub _export_tags_into {
     no strict 'refs';
     tie *{"${into}::${tag}"}, 'XML::Tags::TIEHANDLE', "<${tag}>";
   }
-  my $orig = \&CORE::GLOBAL::glob || sub { CORE::glob($_[0]) };
-  {
-    no warnings 'redefine';
-    *CORE::GLOBAL::glob = sub { '<'.$_[0].'>' };
-  }
   return sub {
     foreach my $tag (@tags) {
       no strict 'refs';