in reply to After listing the folder in a directoy, i unable to zip the folders by using system command.

Some comments:

  1. readdir (with double d) returns all contents of a directory, not only sub-directories.
  2. Your assignment to @folders suggests that you only want sub-directories?
  3. Apart from . and .. you should also exclude the directories starting with your $prefix. Otherwise, you backup them as well if you run the script twice. (Probably that is what you want?)
  4. Your zip command will not work with folder names containing blanks.

  • Comment on Re: After listing the folder in a directoy, i unable to zip the folders by using system command.