Cap'n Steve has asked for the wisdom of the Perl Monks concerning the following question:
Does anyone have an idea what the problem might be? I thought it might have something to do with undefining an array element while looping over the array, but I can't reproduce it outside this script.for (my $i = 0; $i <= $#_; $i++) { next unless $_[$i] =~ /^(.+?)\.(zip|t?gz|tar|bz2?|tbz)$/i or $_[$i] =~ /$config_regexp/i or $_[$i] =~ /banner\d?\.(jpe?g|gif|png)$/i or $_[$i] =~ /^template\.html?$/i; my($volume, $directories, $file) = File::Spec->splitpath($File +::Find::dir); my @dirs = File::Spec->splitdir($directories); # unzip any compressed files if ($_[$i] =~ /^(.+?)\.(zip|t?gz|tar|bz2?|tbz)$/i) { # sometimes File::Temp can't clean up properly for (my $x = 0; $x <= $#_; $x++) { my $dir = File::Spec->catfile($File::Find::dir, $_[$x] +); if (-d $dir && $_[$x] =~ /^$1\-EXTRACTED.{5}$/) { rmtree($dir); undef $_[$x]; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Warning gets the line number wrong?
by merlyn (Sage) on Apr 30, 2007 at 10:47 UTC | |
by Cap'n Steve (Friar) on Apr 30, 2007 at 20:43 UTC | |
by graff (Chancellor) on May 01, 2007 at 09:17 UTC | |
|
Re: Warning gets the line number wrong?
by jesuashok (Curate) on Apr 30, 2007 at 08:41 UTC | |
by Cap'n Steve (Friar) on Apr 30, 2007 at 20:27 UTC | |
|
Re: Warning gets the line number wrong?
by DrHyde (Prior) on Apr 30, 2007 at 08:59 UTC | |
|
Re: Warning gets the line number wrong?
by rodion (Chaplain) on Apr 30, 2007 at 10:33 UTC | |
|
Re: Warning gets the line number wrong?
by naikonta (Curate) on Apr 30, 2007 at 12:46 UTC | |
by Cap'n Steve (Friar) on Apr 30, 2007 at 22:00 UTC |