Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: Optimizing variable passing (code, peer review)

by perlmonkey (Hermit)
on May 11, 2001 at 11:26 UTC ( #79654=note: print w/ replies, xml ) Need Help??


in reply to Optimizing variable passing (code, peer review)

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

use overload "\"\"" => \&as_string;
to the EmmisiveColor class. Then your simple_properties could become:
sub simple_properties { my $self = shift; return "appearance Appearance {\n" . " material Material {\n" . " ". join("\n ", $self->properties). "\n" . " }\n" . "}\n"; }
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. Here is a quick overloading/oop tutorial. (shameless self promotion :)


Comment on Re: Optimizing variable passing (code, peer review)
Select or Download Code
Reaped: Re^2: Optimizing variable passing (code, peer review)
by NodeReaper (Curate) on Sep 21, 2009 at 10:25 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://79654]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2014-09-18 01:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (104 votes), past polls