From: "Kurt V. Hindenburg" Date: 2003-09-13T02:28:02+09:00 Subject: Dir.foreach not with patterns? --Boundary-02=_GKgY/p64avOG7gO Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Description: signed data Content-Disposition: inline Why does the third one not work as expected? It appears that=20 Dir.foreach will not work with patterns... #!/usr/bin/ruby s =3D "/etc/host*" #1 l =3D Dir[s]=20 p l #2 Dir.foreach("/etc") { |d| p d } #3 Dir.foreach(s) { |d| p d } #4 # This is wasteful l =3D Dir[s] l.each { |f| p f } =2D-=20 ^^^ Kurt There is no good nor evil, just power. --Boundary-02=_GKgY/p64avOG7gO Content-Type: application/pgp-signature Content-Description: signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.2 (GNU/Linux) iD8DBQA/YgKG0cAvx3ELfKARAt8dAJ4wrTeNfjRnQZ9XrserhejBSuNGKACggWAk WAnLflpyjLYvLKOZfQH4fcQ= =Fd1o -----END PGP SIGNATURE----- --Boundary-02=_GKgY/p64avOG7gO--