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