Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

staic member in perl

Status
Not open for further replies.

be12dune09a

Programmer
Joined
Nov 17, 2005
Messages
24
Location
RO
How do I make a member of a class static in perl??Like in Java or C#.Can I or can I not do something like that???An exemple will be usefull.
 
What do you mean by "static like in Java or C"?
Do you mean that you want a single value shared by all instances of the class?
Please explain.



Trojan.
 
Yes that is what I want to know.Can I do that??
 
You simply need to declare a scoped variable (with "my") in the scope of the package.
Then your methods can all access this variable.
Be aware, though, that they will all share the one value.
If one instance updates it, the others will all see that update.



Trojan.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top