$self->{_permitted} is a reference to %fields. So we take the keys in %fields (the names of your data members), and for each of those we get the values of those fields held by your object; then we join those values into a colon-separated string. Is that what you wanted?sub pack { my $self = shift; return join ':', map $self->{$_}, keys %{ $self->{_permitted} }; }
In reply to Re: Stumped on an OO Problem
by btrott
in thread Stumped on an OO Problem
by skazat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |