in reply to Re^2: remove files
in thread remove files

my @removed_files =  split, <STDIN>;

You have a comma after the split, so Perl is reading that as split(), <STDIN>, which will try to operate on the special variable $_, which is why you're getting that warning. If you want to read all the lines from STDIN and have each element of the array be one line, it's enough to say:

my @removed_files = <STDIN>; chomp(@removed_files);

I added the chomp to remove the newline that each line will have at the end. Also, I might suggest a different variable name for clarity, such as @files_to_remove, and also you should check the return value of unlink to see if it actually removed a file. For example:

my $removed = unlink($file); print "Removed $removed file(s).\n"; # - or - unlink($file) == 1 or die "Failed to unlink $file: $!";