S
Stefan
Hi...
For I while now I have been coding OO Perl using the $self->{member}
syntax to grab elements out of my blessed hash reference. This works
just fine, however it recently occurred to me that since $self is always
a simple scalar variable (containing a reference), I could just use the
$$self{member} syntax instead. Personally, I find this easier to deal
with - it's one character less to type and occasionally I find it useful
to use @$self{member1, member2}, something which I still haven't figured
out how to do with ->.
So my question... is there anything wrong with using this syntax? The
only reason I ask is that I have never seen an OO Perl module which uses
it... everyone seems to use the $self->{member} version. Sorry if I'm
being and idiot and missing something blatantly obvious!
Thanks
Stefan
For I while now I have been coding OO Perl using the $self->{member}
syntax to grab elements out of my blessed hash reference. This works
just fine, however it recently occurred to me that since $self is always
a simple scalar variable (containing a reference), I could just use the
$$self{member} syntax instead. Personally, I find this easier to deal
with - it's one character less to type and occasionally I find it useful
to use @$self{member1, member2}, something which I still haven't figured
out how to do with ->.
So my question... is there anything wrong with using this syntax? The
only reason I ask is that I have never seen an OO Perl module which uses
it... everyone seems to use the $self->{member} version. Sorry if I'm
being and idiot and missing something blatantly obvious!
Thanks
Stefan