I have the following class:
And I am accessing the class in my script as below:
The output I get is
My question is, because we can access the keys of the blessed hash (second line of output), doesnt that mean I am giving up some information to the end user? It seems like I did the bless thing right as the ref gave me the class name. Am I missing something here, or is this the way it is designed? If so, I cant store any secured information or references in the hash?
Thanks,
VaRaKal
Code:
package MyClass;
sub new {
my $classname = shift;
bless {'a'=>1,'b'=>2}, $classname;
}
1;
And I am accessing the class in my script as below:
Code:
#!/usr/bin/perl -w
use MyClass;
my $objref = MyClass->new();
print ref($objref) . "\n";
print for (keys %$objref);
The output I get is
Code:
MyClass
ab
My question is, because we can access the keys of the blessed hash (second line of output), doesnt that mean I am giving up some information to the end user? It seems like I did the bless thing right as the ref gave me the class name. Am I missing something here, or is this the way it is designed? If so, I cant store any secured information or references in the hash?
Thanks,
VaRaKal