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

Re: My first stab at OO perl...

by astaines (Curate)
on Jul 17, 2002 at 16:01 UTC ( #182479=note: print w/replies, xml ) Need Help??

in reply to My first stab at OO perl...

Very nice - and far better than my first (or indeed current) attempts at OO code. One query - Is it a good idea to have a get_total function which does the additon. My first instinct would be to make add_expenses and delete_expenses keep the _TOTAL up to date at all times. Any opinons on this?

Anthony Staines

Replies are listed 'Best First'.
Re: Re: My first stab at OO perl...
by Theseus (Pilgrim) on Jul 17, 2002 at 16:11 UTC
    I thought about that, but I figured it would be less expensive to do the math only when I actually need the number, rather than every time I would have changed. I figure if I'm going to access the data through a method, I might as well have it generate it on the fly and not when I don't need it.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://182479]
[GotToBTru]: $aohoaoh->[0] is a hash reference, so $aohoaoh->[0]->{ key1} would work
[1nickt]: If 1nickt is the some guy, that's not what he said.
[GotToBTru]: thepkd might not know about last hour of cb
[1nickt]: my $x = $aohoaoh->[0]->{' foo'}->[0]->{'bar' }; should work
[thepkd]: its not $aohoaoh->[0]. its $aohoaoh[0]->{'foo '}. Tried it. Its working. Thnaks
[thepkd]: Hey 1nickt sorry man. What
[GotToBTru]: a ref too far ;)
[thepkd]: Yes this is my first time in cb. Trying to work my way around.

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (12)
As of 2016-12-06 13:39 GMT
Find Nodes?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:

    Results (105 votes). Check out past polls.