[vox-tech] ruby (was: hold on to your hats - perl vs python)

Henry House vox-tech@lists.lugod.org
Thu, 18 Jul 2002 17:45:02 -0700


--A6N2fC+uXW/VQSAv
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Thu, Jul 18, 2002 at 04:49:13PM -0700, Rod Roark wrote:
[...]
> BTW does ruby let you do one-liners as in perl -e?

Indeed. Try:

	echo foo | ruby -pe '$_.tr!("a-z", "A-Z").'

which does require the ugly $_, but nearly matches perl in compactness.

(Sorry, forgot to add this to my last message.)

--=20
Henry House
The attached file is a digital signature. See <http://romana.hajhouse.org/p=
gp>
for information.  My OpenPGP key: <http://romana.hajhouse.org/hajhouse.asc>.

--A6N2fC+uXW/VQSAv
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE9N2ENKK1cAVjXujwRAszbAJ9lEeJErPRRY4/o+JuFaOZ34L/KjwCgopFJ
pxaNooQggSM47klQrkz6O3Y=
=PIhX
-----END PGP SIGNATURE-----

--A6N2fC+uXW/VQSAv--