I'm writing a Perl script which performs linux commands.
I have a directory with a load of files.
exec_cmd('rm $(ls * | grep -v file1)');
This command will delete all except for file1. How can I modify this to delete all files except for file1 & file2?