Re: perl

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

From: Anton Berezin
Subject: Re: perl
Date: 08:36 on 22 Dec 2006
On Fri, Dec 22, 2006 at 02:43:08AM -0500, Sean Conner wrote:

>   Um ... <raises hand> ... I'd like somethimg a bit more consistent.
> 
>   A typical programic idiom I use (when programming in C) is:
> 
> 	if (argc == 1)
> 		do_some_process(stdin);
> 	else
> 	{
> 		for (i = 1 ; i < argc ; i++)
> 		{
> 			input = fopen(argv[i],"r");
> 			do_some_process(input);
> 			fclose(input);
> 		}
> 	}
> 
>   So imagine my surprise when:
> 
> 	if (scalar(@ARGV) == 1)
> 	{	# the one bit of consistancy I can do without actually
> 		&do_some_process(STDIN);
> 	}
> 	else
> 	{
> 		for ($i = 1 ; $i < scalar(@ARGV) ; $i++)
> 		{
> 			open INPUT,$ARGV[i];
> 			&do_some_process(INPUT);
> 			close INPUT;
> 		}
> 	}

Now, this is just silly.  This reminds me of someone complaining that Perl
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 here.

\Anton.
-- 
We're going for 'working' here. 'clean' is for people with skills...
-- Flemming Jacobsen

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