Skip Menu |
 
rt.cpan.org will be shut down on March 1st, 2021.

This queue is for tickets about the Data-Visitor CPAN distribution.

Report information
The Basics
Id: 72899
Status: new
Priority: 0/
Queue: Data-Visitor

People
Owner: Nobody in particular
Requestors: hanenkamp [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.27
Fixed in: (no value)



Subject: Typeglob handling is quirky, also behavior varies by Perl version
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Mailer: MIME-tools 5.427 (Entity 5.427)
Content-Disposition: inline
Content-Transfer-Encoding: binary
X-RT-Original-Encoding: utf-8
Content-Length: 1044
Compare the output of these slight variations (running under perl-5.8.9): perl -MData::Dumper -MData::Visitor::Callback \ -e '$in = { foo => \*STDERR }; $out = Data::Visitor::Callback->new( glob => sub { *{$_} }, plain_value => sub { $_ })->visit($in); print Dumper($out)' ### Output: $VAR1 = { 'foo' => \*::STDERR }; # notice the reference that stays perl -MData::Dumper -MData::Visitor::Callback \ -e '$in = { foo => \*STDERR }; $out = Data::Visitor::Callback->new( glob => sub { *{$_} })->visit($in); print Dumper($out)' ### Output: $VAR1 = { 'foo' => *::STDERR }; # notice the reference that disappears Now the same programs running under perl-5.10.1 have this output, respectively: ### Output: $VAR1 = { 'foo' => undef } # now undefined ### Output: $VAR1 = { 'foo' => *::STDERR } # now still disappearing reference If I change the \*STDERR in these programs to just *STDERR, any use of plain_value => sub { $_ } causes the value to become undefined.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.