note
perlmonkey
I agree with [dws], OOP definatley seems like it would fit
with your project. Plus you could do fun things like
overload the stringify operator by adding<CODE>
use overload "\"\"" => \&as_string;
</CODE> to the EmmisiveColor
class. Then your simple_properties could become:<CODE>
sub simple_properties {
my $self = shift;
return
"appearance Appearance {\n" .
" material Material {\n" .
" ". join("\n ", $self->properties). "\n" .
" }\n" .
"}\n";
}
</CODE>
Overloading a string operator might be quite handy for what it looks like you are doing, and I bet you would find other significant simplifications with an OOP approach. [Basic Objects with Overloaded Operators|Here] is a quick overloading/oop tutorial. (shameless self promotion :)
79629
79629