home *** CD-ROM | disk | FTP | other *** search
/ ftp.cse.unsw.edu.au / 2014.06.ftp.cse.unsw.edu.au.tar / ftp.cse.unsw.edu.au / pub / doc / languages / perl / nutshell / ch4 / readdir < prev    next >
Encoding:
Text File  |  1992-10-18  |  229 b   |  11 lines

  1. opendir(THISDIR, ".");
  2. @allfiles = readdir(THISDIR);
  3. closedir(THISDIR);
  4. print "@allfiles\n";
  5.  
  6. @allfiles = grep(!/^\.\.?$/, readdir(THISDIR));
  7.  
  8. @allfiles = grep(!/^\./, readdir(THISDIR));
  9.  
  10. @textfiles = grep(-T, readdir(THISDIR));
  11.