[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]



--- Object---


{
package OBJ;
use strict;


sub AUTOLOAD {
        my $self = shift;
        print "AUTOLOAD\n";
}


sub new {
        shift;

        #
        # Make sure the type specified is
        # supported
        my $con = {
                'S' => 1,
        };
        bless $con, 'OBJ';   # Tag object with pkg name
        return $con;                     # Return object
}

}


return 1;
--- Program ----
#!/opt/SAM/perl/bin/perl


use OBJ;

my $o = OBJ->new();
print $o->{'S'} ;


Can someone tell me how to make the 'S' private and not accessible?

Thanks,
Chris



</pre>
<!--X-Body-of-Message-End-->
<!--X-MsgBody-End-->
<!--X-Follow-Ups-->
<hr>
<ul><li><strong>Follow-Ups</strong>:
<ul>
<li><strong><a name="00038" href="msg00038.html">[ale] Private members in perl</a></strong>
<ul><li><em>From:</em> cfowler at outpostsentinel.com (Chris Fowler)</li></ul></li>
<li><strong><a name="00043" href="msg00043.html">[ale] Private members in perl</a></strong>
<ul><li><em>From:</em> fletch at phydeaux.org (Fletch)</li></ul></li>
</ul></li></ul>
<!--X-Follow-Ups-End-->
<!--X-References-->
<!--X-References-End-->
<!--X-BotPNI-->
<ul>
<li>Prev by Date:
<strong><a href="msg00036.html">[ale] flash memory device wierdness</a></strong>
</li>
<li>Next by Date:
<strong><a href="msg00038.html">[ale] Private members in perl</a></strong>
</li>
<li>Previous by thread:
<strong><a href="msg00050.html">[ale] flash memory device wierdness</a></strong>
</li>
<li>Next by thread:
<strong><a href="msg00038.html">[ale] Private members in perl</a></strong>
</li>
<li>Index(es):
<ul>
<li><a href="maillist.html#00037"><strong>Date</strong></a></li>
<li><a href="threads.html#00037"><strong>Thread</strong></a></li>
</ul>
</li>
</ul>

<!--X-BotPNI-End-->
<!--X-User-Footer-->
<!--X-User-Footer-End-->
</body>
</html>