in reply to is it possible to access eval() counter?
There is no way I know of to (re)set the eval counter, but the usual trick I use to associate evals with the evalled code is to embed a #line comment in your eval() string:
givesperl -le "eval q!print $^O! for 1..10; eval qq!#line 99 foo.cfg\ndie!; +print $@"
MSWin32 MSWin32 MSWin32 MSWin32 MSWin32 MSWin32 MSWin32 MSWin32 MSWin32 MSWin32 Died at foo.cfg line 99.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: is it possible to access eval() counter? (new#line)
by tye (Sage) on Jun 30, 2006 at 18:11 UTC |