[pm-h] print on warning tip

Kevin Shaum kevin at shaum.com
Fri Mar 31 00:02:56 PST 2006


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


More information about the Houston mailing list