Giter Site home page Giter Site logo

parent's People

Contributors

bulk88 avatar choroba avatar corion avatar daoswald avatar demerphq avatar guillemj avatar haarg avatar jamessan avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

parent's Issues

The 'import' argument list gets propagated to require'd modules

It seems that, because of the code in https://github.com/Corion/parent/blob/master/lib/parent.pm#L14-L17, the arglist @_ gets propagated to require'd modules.

Please, consider these test files:

==> file.pl <==

  use parent qw(A B);
  print "main::ISA is (@main::ISA)\n";

==> A.pm <==

  print "In A, arglist was (@_), ";
  @_ = qw(Foo Bar);
  print "now changed to (@_)\n";

==> B.pm <==

  print "In B, arglist is (@_)\n";

If I run it, I get:

$ perl -I. file.pl
In A, arglist was (A B), now changed to (Foo Bar)
In B, arglist is (Foo Bar)
main::ISA is (Foo Bar)

Notice that A.pm starts with @_ populated and @ISA is wrong? This doesn't looks like intended behavior, is it? Modifying the code to localize @_ before the loop, I get:

$ perl -I. file.pl
In A, arglist was (), now changed to (Foo Bar)
In B, arglist is (Foo Bar)
main::ISA is (A B)

I changed the loop to this: my @filename = @_; local @_; for ( @filename ) {...} (or even for ( my @filename = @_, local @_ ) {...} ). Inserting local @_; inside the for loop would prevent @_ from propagating between modules and I don't think that's necessary.

Would you consider this a legit issue? Let me know if you want a pull request. Thanks.

t/parent-pmc.t still fails on non PMC perls with Config without non_bincompat_options

Hi,

As I commented on the last commit 4bf8adc related to this bug, the correction still does not work for perl without PMC AND Config modules that does not implement non_bincompat_options method...

We encounter the case with perl-5.10.1 compiled without PMC support.

Note that, still in our case, perl -V does not list PERL_DISABLE_PMC in Compile-time options.

So one should add a else clause to the if (Config->can('non_bincompat_options')) as below:

if (Config->can('non_bincompat_options')) {
    ...
} else {
    # Test directly in options used for the compilation
    $no_pmc = $Config{ccflags} =~ /-DPERL_DISABLE_PMC\b/
        || $Config{cppflags} =~ /-DPERL_DISABLE_PMC\b/;
}

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.