home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / lang / perl / 4947 < prev    next >
Encoding:
Text File  |  1992-07-24  |  1.3 KB  |  37 lines

  1. Newsgroups: comp.lang.perl
  2. Path: sparky!uunet!snorkelwacker.mit.edu!thunder.mcrcim.mcgill.edu!poly-vlsi!usenet!sbo
  3. From: sbo@vlsi.polymtl.ca (Stephane Boucher)
  4. Subject: Re: # of files in directory
  5. In-Reply-To: Tom Christiansen's message of Thu, 23 Jul 1992 22:57:15 GMT
  6. Message-ID: <SBO.92Jul24095759@froh.vlsi.polymtl.ca>
  7. Sender: news@vlsi.polymtl.ca (USENET News System)
  8. Organization: Ecole Polytechnique de Montreal
  9. References: <1992Jul23.195931.20791@magnus.acs.ohio-state.edu>
  10.     <1992Jul23.201539.4416@news.eng.convex.com>
  11.     <1992Jul23.211249.21744@magnus.acs.ohio-state.edu>
  12.     <1992Jul23.225715.21531@news.eng.convex.com>
  13. Date: Fri, 24 Jul 1992 14:57:59 GMT
  14. Lines: 21
  15.  
  16. >>>>> On Thu, 23 Jul 1992 22:57:15 GMT, Tom Christiansen <tchrist@convex.COM> said:
  17.  
  18.   >     print "There are ", 
  19.   >         scalar(opendir(F,"/usr/bin"),scalar(grep(!/^\./,readdir(F)))), 
  20.   >     " files!\n"
  21.  
  22. Tom? How did you manage to miss this one? And I tought you
  23. where one of the great :-)
  24.  
  25. with: 
  26.     grep(!/^\./,readdir(F)) 
  27.  
  28. you will miss all the files that start with a dot. It should
  29. read:
  30.  
  31.     grep(!/^\.{1,2}$/,readdir(F))
  32. --
  33.   ,                          ,                           ,
  34. Stephane Boucher, ing. jr. | Ecole Polytechnique de Montreal
  35. sbo@vlsi.polymtl.ca        | Tel: (514)340-5950
  36. sbo@info.polymtl.ca        | Fax: (514)340-4078
  37.