in reply to Re: Learning to *really* love references
in thread Learning to *really* love references
Well...
Long time ago i used to write my code like this:
Since then I use
Anyway IMHO the $$something notation is the worst to read or understand again after some time... If you code alone it's up to you which one to choose, but if I'm a part of a team I just try to be polite, writing my code more readable and easy to understand to my co-workers...
Greetz, Tom.
Long time ago i used to write my code like this:
but when I tried to debug or simply read it a few months after coding, it took me a long time to make my brain think the same, wired way as when I wrote the code ;-)my $arrayElement = $$arrayRef[0]; my $hashValue = $$hashRef{someKey};
Since then I use
ormy $arrayElement = ${$arrayRef}[0]; my $hashValue = %{$hashRef}{key};
and it depends of the mood ;-)my $arrayElement = $arrayRef->[0]; my $hashValue = $hashRef->{key};
Anyway IMHO the $$something notation is the worst to read or understand again after some time... If you code alone it's up to you which one to choose, but if I'm a part of a team I just try to be polite, writing my code more readable and easy to understand to my co-workers...
Greetz, Tom.
In Section
Meditations