in reply to RE: RE: RE: RE: RE: Re: How to tell eval where the code is from
in thread How to tell eval where the code is from
That said, unless I am missing something obvious, I find the above feature to be buggy for perl 5.005_03 on both Windows and Linux. Here is my test:
When I go home tonight I will try this on 5.6 and send a bug report in if I still cannot get it to work.$ perl $str = <<FOO; # line 1 "foo" sub bar { die('gotcha'); } &bar(); FOO print "When executed by eval:\n"; eval($str); print $@; print "When executed by perl:\n"; open (PERL, "| perl") or die "Cannot start perl: $!"; print PERL $str; close PERL; __END__ When executed by eval: gotcha at (eval 1) line 3. When executed by perl: gotcha at foo line 2.
For the record, I consider myself a Perl hacker, not a perl hacker. (VBG)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE (8): How to tell eval where the code is from
by tilly (Archbishop) on Aug 09, 2000 at 17:09 UTC |