Newsgroups: comp.lang.perl
Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!rodney
From: rodney@sun.ipl.rpi.edu (Rodney Peck II)
Subject: Re: Ruminations on the future of Perl
Message-ID: <yvkl1yc@rpi.edu>
Nntp-Posting-Host: ipl.rpi.edu
Organization: Rensselaer Polytechnic Institute, Troy NY
References: <RUSTY.91Jun28181513@groan.Berkeley.EDU> <trklf=c@rpi.edu> <1991Jun30.224532.23556@convex.com>
Date: 30 Jun 91 23:29:08 GMT
Lines: 42

In article <1991Jun30.224532.23556@convex.com> tchrist@convex.COM (Tom Christiansen) writes:
>From the keyboard of rodney@dali.ipl.rpi.edu (Rodney Peck II):
>:In article <RUSTY.91Jun28181513@groan.Berkeley.EDU> rusty@groan.Berkeley.EDU (Rusty Wright) writes:
>:>Similarly, in the "Syntax" section are examples for opening "foo" and
>:>dying if it can't be opened, with the classic
>:>
>:>	open(foo) || die "Can't open $foo: $!";
>:>
>:>(but which I find to be just hackeritis show-off).
>:
>:I don't understand -- I use this all the time.  really.  what's the
>:problem?
>
>Perhaps those folks not heavily into shell programming do not take well 
>to using && and || for flow control.  But those who are, do, and are 
>glad it's there.

hm.  I suppose that's probably what the problem is.  I find it perfectly
normal.  I don't do much with shell scripts, but I used to program in 
Lisp a lot and it's pretty common to write:
  (or (function-1)
      (fun-2)
      (fun-3))

to try a sequence of things to get something done... like:

  (or (open-local)
      (open-remote-via-tftp)
      (open-remote-via-ftp)
      (open-remote-via-rlogin)
      (open-remote-via-telnet))

so... open || die makes perfect sense to me and is very readable.

What isn't so readable is:

$number-- || print "Number is zero.";

then again, maybe it is...

-- 
Rodney
