In my function I am doing this
my $output;
open (MEM, '>', \$output or die "Can't open MEM: $!");
$B::Concise::walkHandle = \*MEM;
But I get the error
Not a GLOB reference at C:/Perl/lib/mycrap.pm line 157.
CHECK failed--call queue aborted.
What should I do
Not a GLOB reference – (F) A fatal error (trappable).
From Perldoc
The most you can get is a reference to a typeglob, which is actually a complete symbol table entry.
But see the explanation of the
*foo{THING}syntax in Perlref link.However, you can still use type globs and globrefs as though they were IO handles.
make something like
$globref = \*foo;For more detail go to See perlref.
As i am seeing your previous questions, i think you are looking for
walk_outputlets you change the print destination from STDOUT to another open filehandle, or into a string passed as a ref (unless you've built perl with -Uuseperlio).see B::Concise & B::Concise – Walk Perl syntax tree, printing concise info about ops for complete examples.