Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
schwern opened this issue Mar 20, 2011 · 2 comments · Fixed by #191
Closed

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

schwern opened this issue Mar 20, 2011 · 2 comments · Fixed by #191

Comments

@schwern
Copy link
Contributor

schwern commented Mar 20, 2011

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
Copy link
Contributor

doherty commented Apr 23, 2011

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.

@schwern
Copy link
Contributor Author

schwern commented Apr 29, 2011

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

@schwern schwern closed this as completed Apr 29, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants