Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the IO-All CPAN distribution.

Report information
The Basics
Id: 72876
Status: rejected
Priority: 0/
Queue: IO-All

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

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



Subject: IO::All::Base::option calls field with caller = "IO::All::Base"
% perl -wle 'use IO::All::Base (); BEGIN { print defined &IO::All::Base::_strict ? "yes" : "no"; } use IO::All (); BEGIN { print defined &IO::All::Base::_strict ? "yes" : "no"; }' no yes So what's going on here is that I had a look at &option in IO/All/Base.pm (while looking for the implementation of &io, but that's a separate issue). IO/All.pm calls option('strict'), which in turn calls field('_strict', 1). The funny thing is that both &option and &field are "magical" in that they use their caller's package to decide where to put the generated sub. The problem is that &option calls &field, and in that case &field's caller is always "IO::All::Base". In other words, every call to option("foo") from anywhere creates a field in IO::All::Base::_foo. I'm not sure how this interacts with inheritance but I think it means if any subclass of IO::All creates an option foo, then suddenly all other subclasses gain a field _foo. I don't think this is the intended behavior.