http://www.perlmonks.org?node_id=644359


in reply to both base and sub class in same file

You don't actually need the first 1; line there, before the package Bar; statement, though it's harmless. And number 1 is apperantly special as it doesn't generate useless constant in void warning, as other constants.
$ perl -c -we '1' -e syntax OK $ perl -c -we '3' Useless use of a constant in void context at -e line 1. -e syntax OK $ perl -c -we '"OK"' Useless use of a constant in void context at -e line 1. -e syntax OK
I frankly wondered at first, but, fortunately diagnostics has the fact:
This warning will not be issued for numerical constants equal to 0 or 1 since they are often used in statements like
1 while sub_with_side_effects();
String constants that would normally evaluate to 0 or 1 are warned about.
One more thing, if you really need Foo from Bar, you might consider to use @ISA for inheritance or Exporter for importing Foo's symbols.

Open source softwares? Share and enjoy. Make profit from them if you can. Yet, share and enjoy!