Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uunet!convex!convex.COM From: tchrist@convex.COM (Tom Christiansen) Newsgroups: comp.lang.perl Subject: Re: Silent Bomb Message-ID: <100570@convex.convex.com> Date: 14 Mar 90 10:17:40 GMT References: <11238@deimos.ADS.COM> Sender: news@convex.com Reply-To: tchrist@convex.COM (Tom Christiansen) Organization: CONVEX Software Development, Richardson, TX Lines: 33 In article <11238@deimos.ADS.COM> dglo@deimos.ads.com (Dave Glowacki) writes: >I converted a shell script to a perl script and spent a couple hours >trying to track down the following sort of error. Is there any way >to get error messages from a file included via 'do'? I use this: % cat source.pl ########################################################################### 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. --tom -- Tom Christiansen {uunet,uiucdcs,sun}!convex!tchrist Convex Computer Corporation tchrist@convex.COM "EMACS belongs in : Editor too big!"