sub floober { my ($self, $c) = @_; }
sub new { my $class = shift; my ($params) = @_; my $self = bless {}, $class; $self->{engine} = $params->{engine}; Scalar::Util::weaken( $self->{engine} ); return $self; }
BUT ... you really need to use one of them. Messing around with globals is bad juju. That you're asking here is a sign that you feel it smells wrong. That's the sign of a software journeyman. To demonstrate mastery, you need to learn why it smells and how to avoid it.
In reply to Re: Proper way to create 'globals'
by dragonchild
in thread Proper way to create 'globals'
by zaven
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |