Skip to content

Instantly share code, notes, and snippets.

@xaicron
Created April 2, 2014 08:51
Show Gist options
  • Save xaicron/9930396 to your computer and use it in GitHub Desktop.
Save xaicron/9930396 to your computer and use it in GitHub Desktop.
diff --git a/lib/File/Find.pm b/lib/File/Find.pm
index d1dbc52..196acfc 100644
--- a/lib/File/Find.pm
+++ b/lib/File/Find.pm
@@ -364,8 +364,8 @@ require File::Spec;
# Should ideally be my() not our() but local() currently
# refuses to operate on lexicals
-our %SLnkSeen;
-our ($wanted_callback, $avoid_nlink, $bydepth, $no_chdir, $follow,
+my %SLnkSeen;
+my ($wanted_callback, $avoid_nlink, $bydepth, $no_chdir, $follow,
$follow_skip, $full_check, $untaint, $untaint_skip, $untaint_pat,
$pre_process, $post_process, $dangling_symlinks);
@@ -474,8 +474,8 @@ sub _find_opt {
# This function must local()ize everything because callbacks may
# call find() or finddepth()
- local %SLnkSeen;
- local ($wanted_callback, $avoid_nlink, $bydepth, $no_chdir, $follow,
+ my %SLnkSeen;
+ my ($wanted_callback, $avoid_nlink, $bydepth, $no_chdir, $follow,
$follow_skip, $full_check, $untaint, $untaint_skip, $untaint_pat,
$pre_process, $post_process, $dangling_symlinks);
local($dir, $name, $fullname, $prune);
@@ -513,7 +513,7 @@ sub _find_opt {
$dangling_symlinks = $wanted->{dangling_symlinks};
# for compatibility reasons (find.pl, find2perl)
- local our ($topdir, $topdev, $topino, $topmode, $topnlink);
+ my ($topdir, $topdev, $topino, $topmode, $topnlink);
# a symbolic link to a directory doesn't increase the link count
$avoid_nlink = $follow || $File::Find::dont_use_nlink;
@@ -666,7 +666,7 @@ sub _find_dir($$$) {
$dir_pref= ( $p_dir eq '/' ? '/' : "$p_dir/" );
}
- local ($dir, $name, $prune, *DIR);
+ my ($dir, $name, $prune); local(*DIR);
unless ( $no_chdir || ($p_dir eq $File::Find::current_dir)) {
my $udir = $p_dir;
@@ -886,7 +886,7 @@ sub _find_dir_symlnk($$$) {
$dir_pref = ( $p_dir eq '/' ? '/' : "$p_dir/" );
$loc_pref = ( $dir_loc eq '/' ? '/' : "$dir_loc/" );
- local ($dir, $name, $fullname, $prune, *DIR);
+ my ($dir, $name, $fullname, $prune); local(*DIR);
unless ($no_chdir) {
# untaint the topdir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment