in reply to Why does $$self++ works?
Most languages implement objects as "blessed" hashes, and that's also the overwhelming case in Perl.
But in Perl you are free to use any reference as a container for the state of the instance.
And that's what is happening here, you have a blessed scalar (ref)
See bless ...
... and perlobj#An-Object-is-Simply-a-Data-Structure
> Objects are merely Perl data structures (hashes, arrays, scalars, filehandles, etc.) that have been explicitly associated with a particular class.
> That explicit association is created by the built-in bless function, which is typically used within the constructor subroutine of the class.
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
FootballPerl is like chess, only without the dice
|
|---|