Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re^3: Perl class - how to create instance variable instead of class variable

by TGI (Parson)
on Dec 20, 2010 at 05:36 UTC ( [id://877955]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    package Test;
    use strict;
    ...
            $self{theValue} = $value;
    } 
    1;
    
  2. or download this
    Global symbol "%self" requires explicit package name at Test.pm line 1
    +5.
    Global symbol "%self" requires explicit package name at Test.pm line 2
    +2.
    
  3. or download this
        (F) You've said "use strict" or "use strict vars", which indicates
    + 
        that all variables must either be lexically scoped (using "my" or 
    +"state"), 
        declared beforehand using "our", or explicitly qualified to say 
        which package the global variable is in (using "::").
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2024-04-19 01:13 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found