0

In C we have what we call dangling pointers where if a pointer is pointing to something else and if that something else is deallocated or removed from memory then the pointer that is pointing to that something else is now a dangling pointer. I've been learning the basics of perl but never get to touch pointers. Are there possibilities in PERL to have a dangling pointer? or can we even create pointers in PERL? i'm doing console apps and not for the web.

3
Contributors
2
Replies
4
Views
9 Years
Discussion Span
Last Post by KevinADC
0

In perl you have got reference , it cannot be dangling. The memory management is taken care by the langauge.

0

Yes, with perl this should not be a problem although it does help to properly declare variables within the intended scope of their use using "my", "our", or "local" when and where appropriate.

As ithelp has said, in perl they are called references. They are mostly used to create complex data strucutes, like a multi-dimensional array or hash, but can be used for other things.

http://perldoc.perl.org/functions/ref.html

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.