|
Re: print on warning tip: msg#00029lang.perl.perl-mongers.houston
On Thursday 30 March 2006 12:47 pm, Paul Archer wrote: > This hints at an answer, but the problem is that I need to print a > lexically scoped variable. Would the plain print statement form work if you put the BEGIN block within the scope of the variable you want to print? If that doesn't work, try making it an INIT block instead of a BEGIN block. (Executes at the beginning of program execution, instead of at the beginning of program compilation.) And if that doesn't work, try enclosing the print statement within an eval {...} or eval "...". (The latter is slower, but is compiled at execution time instead of compile time, so it might be able to capture the lexical variable.) And if that doesn't work... well, I'm out of ideas; go back to the way you were doing it. :-) Kevin
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Tips and Tricks, G. Wade Johnson |
|---|---|
| Previous by Thread: | [pm-h] print on warning tip, Paul Archer |
| Next by Thread: | [pm-h] Deja vu, G. Wade Johnson |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |