Special_K has asked for the wisdom of the Perl Monks concerning the following question:
I am reviewing code which has the following at the top of the script:
#!/tool/bin/perl use strict; use warnings;
Then inside each subroutine it includes the same:
sub sub1 { use strict; use warnings; ... } sub sub2 { use strict; use warnings; ... } sub subN { use strict; use warnings; ... }
Is there any purpose to this seemingly redundant use of "use strict" and "use warnings" or can these statements be removed from each individual subroutine if I keep them at the top of the script?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Possible redundant use of "use strict" and "use warnings"?
by haukex (Archbishop) on Mar 09, 2020 at 18:11 UTC | |
|
Re: Possible redundant use of "use strict" and "use warnings"?
by Your Mother (Archbishop) on Mar 09, 2020 at 18:53 UTC | |
|
Re: Possible redundant use of "use strict" and "use warnings"?
by LanX (Saint) on Mar 09, 2020 at 19:06 UTC | |
|
Re: Possible redundant use of "use strict" and "use warnings"?
by Perlbotics (Archbishop) on Mar 09, 2020 at 18:14 UTC | |
by haukex (Archbishop) on Mar 09, 2020 at 18:22 UTC | |
|
Re: Possible redundant use of "use strict" and "use warnings"?
by Anonymous Monk on Mar 10, 2020 at 02:34 UTC |