D
Derek Basch
Hello all,
I have ran into a very confusing problem and I hoped someone could help
me. This function is supposed to return a hash of the accessors and
their associated values for a given class.
------------------------------------------
package Test;
sub accessors_values {
my $self = shift;
my %accessors_values;
foreach $_ ($self->accessors()) {
print "$_\n";
my $value = $self->_accessor_class($_)->get($_);
print "$_ : $value\n";
}
return %accessors_values;
}
.........
------------------------------------------
Gives this output:
------------------------------------------
password
### : carefree
user_id
### : 323227
first_login
### : 2006.08.08.12.47.13
last_login
### : 2006.08.08.12.47.13
------------------------------------------
Where the heck is the '###' coming from? How is assigning a value to
the $value variable causing the implicit iterator variable $_ to become
'###' ?
The functions that the code calls are large so I will give a synopsis
of what they return:
$self->accessors returns an array of accessor names
$self->_accessor_class returns a hash ref to a class
$self->get returns a scalar value
Any help is greatly appreciated.
Thanks,
Derek Basch
I have ran into a very confusing problem and I hoped someone could help
me. This function is supposed to return a hash of the accessors and
their associated values for a given class.
------------------------------------------
package Test;
sub accessors_values {
my $self = shift;
my %accessors_values;
foreach $_ ($self->accessors()) {
print "$_\n";
my $value = $self->_accessor_class($_)->get($_);
print "$_ : $value\n";
}
return %accessors_values;
}
.........
------------------------------------------
Gives this output:
------------------------------------------
password
### : carefree
user_id
### : 323227
first_login
### : 2006.08.08.12.47.13
last_login
### : 2006.08.08.12.47.13
------------------------------------------
Where the heck is the '###' coming from? How is assigning a value to
the $value variable causing the implicit iterator variable $_ to become
'###' ?
The functions that the code calls are large so I will give a synopsis
of what they return:
$self->accessors returns an array of accessor names
$self->_accessor_class returns a hash ref to a class
$self->get returns a scalar value
Any help is greatly appreciated.
Thanks,
Derek Basch