home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.perl
- Path: sparky!uunet!gatech!concert!sas!mozart.unx.sas.com!kent
- From: kent@manzi.unx.sas.com (Paul Kent)
- Subject: or puzzlement
- Originator: kent@manzi.unx.sas.com
- Sender: news@unx.sas.com (Noter of Newsworthy Events)
- Message-ID: <BrtMFu.D0L@unx.sas.com>
- Date: Thu, 23 Jul 1992 02:47:54 GMT
- Nntp-Posting-Host: manzi.unx.sas.com
- Organization: SAS Institute Inc.
- Lines: 47
-
-
-
- hi,
-
- in some sub xx, i currently do the moral equivalent of:
-
- sub xx
- {
- opendir(D,$f) || warn "no dir $f" || return 1;
- }
-
- which to my app is a non-fatal warning -- typically my outer loop
- will do
-
- &sub() && next;
-
-
-
-
- is it guarenteed that warn <stuff> will evaluate
- to 0/false forcing the next thing in the or-sequence to be
- evaluated, or am i just getting "lucky" (warn in the camel
- book doesnt describe its result -- it may be grandfathered
- elsewhere....)
-
-
- i know i can do:
-
- opendir(D,$f) || do
- { warn "no $f";
- return 1;
- };
-
-
- but that seems ugly. is there a better idiom for things like
-
- dothis || warn_and_return
- dothis || warn_and_next
-
-
-
- thanks for any input on good perlstyle you might send...
- paul.
- --
-
- Paul Kent (SQL r&d) " nothing ventured, nothing disclaimed "
- kent@unx.sas.com SAS Institute Inc, SAS Campus Dr, Cary NC 27513-2414.
-