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:
> > 
> > >   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.
> 
>   Um ...
> 
>   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 programmer
> speaking?)


No.

You just don't seem to know Perl.


Abigail

Attachment: pgplQVKRZ0oHz.pgp
Description: PGP signature

Reply via email to