Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

No way to turn off redefine warning in alias() #185

Closed
schwern opened this Issue · 2 comments

2 participants

@schwern
Owner

Because it is turned on lexically inside perl5i there is no way to quiet the "subroutine redefined" warning inside alias short of turning off all warnings with -X.

$ perl5i -le 'no warnings; sub foo { 42 }  sub { 23 }->alias("foo")'
Subroutine main::foo redefined at /Users/schwern/perl5/perlbrew/perls/perl-v5.12.2/lib/site_perl/5.12.2/perl5i/2/UNIVERSAL.pm line 21.

The simple fix would be to turn off that warning inside alias and assume the user meant to do that.

Thoughts?

@doherty

Is possible to make that warning come from the right place? I'm not sure how you catch a warning.

Patch done the easy way to follow shortly.

@doherty doherty referenced this issue from a commit in doherty/perl5i
@doherty doherty Silence redefine warnings in alias()
This blindly turns off redefine warnings in alias() on the
assumption that the user means to do that.

Fixes #185
2e5ccb2
@schwern
Owner

Fixed by #191. Simply silencing redefine warnings when aliasing.

@schwern schwern closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.