Re: perl

[prev] [thread] [next] [lurker] [Date index for 2006/12/22]

From: Abigail
Subject: Re: perl
Date: 10:03 on 22 Dec 2006
--FoLtEtfbNGMjfgrs
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Fri, Dec 22, 2006 at 03:44:22AM -0500, Sean Conner wrote:
> It was thus said that the Great Anton Berezin once stated:
> > On Fri, Dec 22, 2006 at 02:43:08AM -0500, Sean Conner wrote:
> >=20
> > >   Um ... <raises hand> ... I'd like somethimg a bit more consistent.
> > >=20
> > >   A typical programic idiom I use (when programming in C) is:
> > >=20
> > > 	if (argc =3D=3D 1)
> > > 		do_some_process(stdin);
> > > 	else
> > > 	{
> > > 		for (i =3D 1 ; i < argc ; i++)
> > > 		{
> > > 			input =3D fopen(argv[i],"r");
> > > 			do_some_process(input);
> > > 			fclose(input);
> > > 		}
> > > 	}
> > >=20
> > >   So imagine my surprise when:
> > >=20
> > > 	if (scalar(@ARGV) =3D=3D 1)
> > > 	{	# the one bit of consistancy I can do without actually
> > > 		&do_some_process(STDIN);
> > > 	}
> > > 	else
> > > 	{
> > > 		for ($i =3D 1 ; $i < scalar(@ARGV) ; $i++)
> > > 		{
> > > 			open INPUT,$ARGV[i];
> > > 			&do_some_process(INPUT);
> > > 			close INPUT;
> > > 		}
> > > 	}
> >=20
> > Now, this is just silly.  This reminds me of someone complaining that P=
erl
> > sucks because Perl code is difficult to read by C programmers.  Perl is
> > hateful, but not for these reasons.  You are just trying to write C her=
e.
>=20
>   Um ...
>=20
>   Unix is written in C.  Perl came to life in the Unix universe.  Plenty =
of
> Unix utilities like cat, sed, od, grep and less (and more) can be used on
> files or in pipes.  This idiom is pretty strong in the Unix world.  Perl
> seems to go out of its way to prevent this (or is that me as a C programm=
er
> speaking?)


No.

You just don't seem to know Perl.


Abigail

--FoLtEtfbNGMjfgrs
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFFi61pBOh7Ggo6rasRAmy2AJ0fDS45bMxUfUtb8V9K0FbSVnNAhwCdGZIK
DAsAxkTjkOEVg8G0uLBLG3Q=
=PN/C
-----END PGP SIGNATURE-----

--FoLtEtfbNGMjfgrs--
There's stuff above here

Generated at 14:01 on 28 Dec 2006 by mariachi 0.52