{ # one scope no warnings; # but the eval generates an inner scope { # where this over-rides the outer scope no warnings # or $^W = 0 - the inner scope reigns supreme. use warnings; } } #### #!/usr/bin/perl use strict; use warnings; use reload; do { print "Hit Enter.\n"; reload::reload("foo"); foo::bar(); reload::reload("reload"); } while ; package reload; use warnings; use strict; { no warnings; sub reload { my ($PM) = @_; delete $INC{"$PM.pm"}; eval "require $PM"; } } 1; package foo; use strict; use warnings; sub bar { print "Works\n" } 1; __DATA__ C:\>perl test.pl Hit Enter. Works Hit Enter. Subroutine bar redefined at foo.pm line 4, line 1. Works Hit Enter. Subroutine bar redefined at foo.pm line 4, line 2. Works Hit Enter. Subroutine bar redefined at foo.pm line 4, line 3. Works Hit Enter. Subroutine bar redefined at foo.pm line 4, line 4. Works Hit Enter. Subroutine bar redefined at foo.pm line 4, line 5. Works ^C C:\>