PadreIDE / Debug-Client

Debug::Client
1 stars 4 forks source link

Fix broken loading of local modules under Perl 5.26 #7

Closed kentfredric closed 7 years ago

kentfredric commented 7 years ago

Perl 5.26 breaks the implication that:

  use inc::Module::Install;
  use t::lib::Debugger;

Will load:

  ./inc/Module/Install.pm
  ./t/lib/Debugger.pm

Respectively, due to '.' ceasing to be in @INC

This fixes:

Some of the existing code ( eg: use_ok ) was already spurious and not very smart, because calling ->import while being outside of BEGIN { } has limited usefullness.

But this was left with the semantically equivalent code that retains the loading of the relative path.

There are strategies that would be "nicer" than what I've done, but they all wind up with you wanting to rename "Debugger.pm" to something else, because:

  use lib "t/lib";
  use Debugger;

Is going to give people a much different impression from either

  use t::lib::Debugger

Or

  BEGIN {
    require "./t/lib/Debugger.pm";
    t::lib::Debugger->import();
  }

This closes https://github.com/PadreIDE/Debug-Client/issues/6

manwar commented 7 years ago

Thanks @kentfredric for the PR. I will try to release the patch in the next couple of days.

Best Regards, Mohammad S Anwar

manwar commented 7 years ago

Merged and pushed, thanks @kentfredric