Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: both base and sub class in same file

by naikonta (Curate)
on Oct 12, 2007 at 00:51 UTC ( #644359=note: print w/ replies, xml ) Need Help??


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!


Comment on Re: both base and sub class in same file
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://644359]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (10)
As of 2015-07-06 11:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (72 votes), past polls