On 3/27/06, Practical Perl <[EMAIL PROTECTED]> wrote:
> Thanks all.
> Again,how about the difference about a pointer and a reference?

Perl does Grabage Collection (cleaning up unused memory) for you.  It
does this by keeping a count of the number of references a block of
memory has.  When this count reaches zero the memory can be marked as
unused.  If Perl had C like pointers they could be considered  weak
references (ones that did not increment the number of references to
the block memory).  Luckily it is quite hard to achieve that effect in
Perl (it is possible) since it would cause the same sort of problems
pointers cause in C (pointing to blocks of unused memory, confusion
about what is being pointed to, null pointers, etc.).

For more information you should read

http://perldoc.perl.org/perlreftut.html
http://perldoc.perl.org/perlref.html

or

perldoc perlreftut
perldoc perlref

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to