Subject: | Callback on 'pre_open' not called when glob expands to one include file |
Hi Thomas,
As said in the subject, when the include glob pattern expands to one include file the 'pre_open' callback is not called.
The fix is either:
Solution 1)
447c447,449
< $configfile = $include[0];
---
Show quoted text
> $configfile = shift(@include);
> ($cont) = $this->_hook('pre_open', $configfile);
> return if(!$cont);
or a matter of preference
Solution 2)
446,447c446,450
< if (@include == 1) {
< $configfile = $include[0];
---
Show quoted text> # Multiple results, one or no expansion results (which is fine,
> # include foo/* shouldn't fail if there isn't anything matching)
> # rt.cpan.org#79869: local $this->{IncludeGlob};
> for (@include) {
> $this->_open($_);
449,457c452
< else {
< # Multiple results or no expansion results (which is fine,
< # include foo/* shouldn't fail if there isn't anything matching)
< # rt.cpan.org#79869: local $this->{IncludeGlob};
< for (@include) {
< $this->_open($_);
< }
< return;
< }
---
Show quoted text> return;
Regards,
Niels