Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!umich!samsung!zaphod.mps.ohio-state.edu!usc!elroy.jpl.nasa.gov!jpl-devvax!lwall From: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Newsgroups: comp.lang.perl Subject: Re: Why does die with no args exit in eval? Message-ID: <8537@jpl-devvax.JPL.NASA.GOV> Date: 29 Jun 90 05:57:32 GMT References: <438@oha.UUCP> Reply-To: lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) Organization: Jet Propulsion Laboratory, Pasadena, CA Lines: 28 In article <438@oha.UUCP> tony@oha.UUCP (Tony Olekshy) writes: : When I run each of the following through perl 3.0.1.5 patch level 18: : : print "Test 1\n"; eval 'die "me"'; print "> $@"; : print "Test 2\n"; eval 'die ""'; print "> $@"; : print "Test 3\n"; eval 'die'; print "> $@"; : : I get the following output (and I say there should be a > from each case): : : Test 1 : > me at (eval) line 1. : Test 2 : Test 3 : : Am I: 1) missing something, 2) misunderstanding something, or 3) triggering : a bug? Mmm, let's just say the "die" routine was coded by a stupid programmer before eval even existed, and he didn't anticipate that die should always be trapped by eval. The programmer has been severely reprimanded and promises never to do it again. The problem will be fixed in the next patch. If you give a null argument to die it will now be as if you said die "Died"; And an enclosing eval will trap it. Larry