creativecoder has asked for the wisdom of the Perl Monks concerning the following question:

i want to know if Perl support the use of pointers and memory address like in C and C++
  • Comment on do Perl supoort the use of memory address and pointers

Replies are listed 'Best First'.
Re: do Perl supoort the use of memory address and pointers
by locked_user sundialsvc4 (Abbot) on Apr 23, 2013 at 11:31 UTC

    Well, there’s Pointer ...

    Like most postmodern languages, Perl has the concept of references (see perlreftut), which are similar to pointers in that they “refer to” other things, but different in that (a) they know what sort of thing they are referring to, and (b) every thing always knows how many references to it currently exist.   Furthermore, memory objects are automatically “garbage collected.”   You don’t have to free them explicitly.

      Also of interest: Devel::PeekPoke which (quite shockingly) has a pure-Perl implementation.

      package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name
Re: do Perl supoort the use of memory address and pointers
by Rahul6990 (Beadle) on Apr 23, 2013 at 11:54 UTC
Re: do Perl supoort the use of memory address and pointers
by Discipulus (Canon) on Apr 24, 2013 at 07:21 UTC
    short answer: no.

    L*
    there are no rules, there are no thumbs..