need a crutch, (was: precedence)
C. Abney
cabney at cyberpass.net
Sat Mar 11 11:53:03 CST 2000
~sdpm~
> (2)[2136]$ cat or_unless.pl
> #! /usr/bin/perl
> $FOO = shift;
> $ERR = shift;
> $ERR or warn "gah!\n" unless $FOO;
Hmm, I actually posted this to ask a question... guess I was too tired
to continue. I tried to use braces/parens to make the evaluation order
explicit or obvious, but kept getting syntax errors.
I can do a:
$opt_D ? ( $DEBUG=1 ) : ( $DEBUG=0 ); # better is "$DEBUG = $opt_D ? 1 : 0;"
to force perl to my will, but when I try it with the above code I get
syntax errors. What should I do to make it more obvious?
Something like:
$ERR or ( warn "gah!\n" unless $FOO );
Except it should work!
CA
--
Einstein himself said that God doesn't roll dice. But he was wrong. And
in fact, anyone who has played role-playing games knows that God
probably had to roll quite a few dice to come up with a character like
Einstein. -- Larry Wall C. Abney
~sdpm~
The posting address is: san-diego-pm-list at hfb.pm.org
List requests should be sent to: majordomo at hfb.pm.org
If you ever want to remove yourself from this mailing list,
you can send mail to <majordomo at happyfunball.pm.org> with the following
command in the body of your email message:
unsubscribe san-diego-pm-list
If you ever need to get in contact with the owner of the list,
(if you have trouble unsubscribing, or have questions about the
list itself) send email to <owner-san-diego-pm-list at happyfunball.pm.org> .
This is the general rule for most mailing lists when you need
to contact a human.
More information about the San-Diego-pm
mailing list