Giter Site home page Giter Site logo

alt-pm's People

Contributors

ingydotnet avatar sharyanto avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

alt-pm's Issues

Example for alternative Alt::Assert assertion (require Alt::...; Alt::...->assert) doesn't work

The docs for Alt::Assert hold that the following should work in code which wants to insure that the Alt version of the module is being used:

require Foo::Bar;
require Alt::Foo::Bar::MSTROUT;
Alt::Foo::Bar::MSTROUT->assert;

Unfortunately, that results in the error:

Bad syntax in alternate module name 'main', should be Alt::<Original::Module>::<phrase>

because Alt::Assert::assert deduces the package name from caller if no argument is specified:

4 sub assert {
5     my $self  = shift;
6     my $mod   = shift || caller();

So,

Alt::Foo::Bar::MSTROUT->assert( 'Alt::Foo::Bar::MSTROUT' );

although inelegant, works.

PERL_ALT_INSTALL=OVERWRITE is too broad

This is not a problem if I only ever do $CPAN_CLIENT Alt::Foo directly. But if something else declares a dep on Alt::Foo and I want to install that, and I set the env variable in order to be able to, there is a problem. Just because I set PERL_ALT_INSTALL=OVERWRITE to install Alt::Foo doesn’t mean I’m consenting to Alt::Bar and Alt::Baz as well. Yet, if those happen to lurk further in the dep chain than I’ve looked, then I have just asked for my perl to get screwed.

Instead the consent given should be specific, i.e. PERL_ALT_INSTALL=Alt::Foo. That way it’s clear that I’m consenting only to the Alt:: version of Foo, not just any ol’ Alt:: on CPAN (come one, come all! etc).

Objections:

  • This protects against a pretty unlikely scenario with several dumb decisions already made.
  • It cannot stop malicious distros since it requires voluntary participation on the part of Makefile.PL, rather than being enforced at the CPAN client level.

Still, given the nature of Alt::, I think a belt-and-suspenders approach is called for.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.