Hi,
I'm wanting to perform a series of regex's on a number of properties for an object. I've tried something similar to;
# ------------------------
my $object = class->new("xxxxxx"
foreach my $field (@fields) {
my $item = $object->{$field};
# .. then perform regex's on $item
}
# ------------------------
When I try to assign the value of "$object->{$field}" to "$item", I receive the error;
"Can't use string ("1" as a HASH ref while "strict refs"
in use at."
Would anyone be able to provide the correct way to reference "$object->{$field}" ?
Any help is appreciated!
--- Pete
I'm wanting to perform a series of regex's on a number of properties for an object. I've tried something similar to;
# ------------------------
my $object = class->new("xxxxxx"
foreach my $field (@fields) {
my $item = $object->{$field};
# .. then perform regex's on $item
}
# ------------------------
When I try to assign the value of "$object->{$field}" to "$item", I receive the error;
"Can't use string ("1" as a HASH ref while "strict refs"
in use at."
Would anyone be able to provide the correct way to reference "$object->{$field}" ?
Any help is appreciated!
--- Pete