Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: both base and sub class in same file

by naikonta (Curate)
on Oct 12, 2007 at 00:51 UTC ( [id://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!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others imbibing at the Monastery: (2)
As of 2024-04-25 20:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found