Subject: | removing dirs enclosed by curly braces |
Hi there, I'm using a application which writes out temp directories
enclosed in curly braces
e.g. /tmp/{6543}
The test below hopefully illustrates the problem I'm getting removing
these sorts of directories
#!/usr bin/perl -w
use strict;
use Test::More qw( no_plan );
use File::Remove qw( remove );
use Data::Dumper;
my $dir = '{6543}';
ok( -e $dir, $dir." exists" );
my @removed = remove( \1, $dir);
print Dumper \@removed;
ok(! -e $dir, $dir." removed" );
my $other_dir = '_6543_';
ok( -e $other_dir, $other_dir." exists" );
@removed = remove( \1, $other_dir);
print Dumper \@removed;
ok(! -e $other_dir, $other_dir." removed");
__END__
ok 1 - {6543} exists
$VAR1 = ['6543'];
not ok 2 - {6543} removed
# Failed test (file_remove_bug.pl at line 12)
ok 3 - _6543_ exists
$VAR1 = ['_6543_'];
ok 4 - _6543_ removed
1..4
# Looks like you failed 1 test of 4
As you can see, the 'curly braced' dir doesn't get removed, but the
remove function returns the dir name
without the curly braces (in list context, 1 in scalar)
I get the same outcome on windows and linux
File::Remove v0.38
Windows (ActiveState): v5.8.8 built for MSWin32-x86-multi-thread
Linux (suse): v5.8.7 built for x86_64-linux
Thanks a lot!
Coxy