Path: utzoo!attcan!uunet!jarthur!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: Silent Bomb Message-ID: <7430@jpl-devvax.JPL.NASA.GOV> Date: 15 Mar 90 17:51:35 GMT References: <11238@deimos.ADS.COM> <100570@convex.convex.com> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 28 In article <100570@convex.convex.com> tchrist@convex.COM (Tom Christiansen) writes: : ########################################################################### : sub source { : local($file) = @_; : local($return) = 0; : : $return = do $file; : die "couldn't parse $file: $@" if $@; : die "couldn't do $file: $!" unless defined $return; : die "couldn't run $file" unless $return; : $return; : } : : 1; : ########################################################################### : : I haven't entirely decided yet whether I want the $@ check : before the $! check, but I've recently switched them around : to the state you now see. The message "couldn't parse..." isn't quite accurate, since $@ can be set by run-time errors as well as compile-time errors. It might parse fine, but suppose you divide by 0... It might even be that the 3rd condition will never be met unless they leave the 1; off the end. Larry