This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
subroutine redefinitions made with local() shouldn't warn
authorTomasz Konojacki <me@xenu.pl>
Wed, 26 Jan 2022 23:55:21 +0000 (00:55 +0100)
committerxenu <me@xenu.pl>
Thu, 27 Jan 2022 16:39:18 +0000 (17:39 +0100)
commitebfc9d5d0d50ffc852e4ae35a78e6a922ada8700
tree9fa139966e9e563be1e43faef9258e6b208adc3e
parent14ec34b7df6625ee06bdc8026925e485eaaf7cd5
subroutine redefinitions made with local() shouldn't warn

The following code will no longer warn:

  use warnings 'redefine';
  sub foo {}
  local *foo = sub{};

The main purpose of local() is to temporarily redefine stuff, so it
doesn't make sense to warn about it.
pod/perldelta.pod
sv.c
t/lib/warnings/sv