this might not be wrong. but it makes more since. Your while statement reads the array in as 0,1,2,3.... But you then set $x = pop(@delete_me); which removes the last element of @delete_me and sets it to $x. Doesnt make to much since to me. so lets rewrite it as.
foreach (@delete_me) {
my $file = $_;
unlink $file or die "Can't unlink $file : $!\n";
}
or you can simple do
foreach (@delete_me) {
unlink $_ or die "Can't unlink $file : $!\n";
}
-bn