--DSPAM_MULTIPART_EX-13582
Content-Type: multipart/signed;
boundary="nextPart1398676.4MVO2BJ6Cx";
protocol="application/pgp-signature";
micalg=pgp-sha1
--nextPart1398676.4MVO2BJ6Cx
Content-Type: text/plain;
charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
Let's say I have an array defined as:
=20
@people =3D ["Jim", "Jen", "Jess", "Jay", "Jack", "John", "Jeff", "Jed",
"Jill"]
=20
How would I then print out the first 5 records of that array? (i.e. from
Jim to Jack)
=20
Any ideas?
One idea comes to mind:
@people.inject([]){|a,p|a<<p if a.length<5;a}.each{|p|puts p}
Anyone wanna throw in callcc too?
Cheers,
=2D-=20
Konrad Meyer <
[email protected]>
http://konrad.sobertillnoon.com/
--nextPart1398676.4MVO2BJ6Cx
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
iD8DBQBGxtNhCHB0oCiR2cwRApkrAJ0Vs5pCf5DM9Oos/d/rdH6eqt4YpACgw/dZ
gHaqlc4CwQSj3JU+M1JWhAc=
=FbuK
-----END PGP SIGNATURE-----
--nextPart1398676.4MVO2BJ6Cx--
--DSPAM_MULTIPART_EX-13582
Content-Type: text/plain
X-DSPAM-Signature: 46c6d363135821228095555
!DSPAM:46c6d363135821228095555!
--DSPAM_MULTIPART_EX-13582--