in reply to What does arrow (->) refer to?

-> is the deference operator (see The Arrow Operator). It is used to resolve a value from a reference (a reference is like a pointer, see perlreftut). The lines like @entries = $mesg->entries; are using a blessed reference in an object oriented fashion to call an associated method. You can learn a bit about object oriented programming in Perl in perlboot. If any of this is unlcear, I'd be happy to answer any follow-ups.

Replies are listed 'Best First'.
Re^2: What does arrow (->) refer to?
by Anonymous Monk on Dec 01, 2009 at 17:56 UTC
    Thanks for explaining me in the logical way. If possible, could you please explain it with an example. Just a brief one with any sample value.
      There's a lot going on with even a simple example, so I'd really recommend reading perlboot and possibly perltoot, but the following is a basic object implementation:

      File: Foo.pm

      package Foo; use strict; use warnings; sub new { return bless {}; } sub method { return "The value returned by method"; } return 1;

      and the script

      #!/usr/bin/perl use strict; use warnings; use Foo; my $object = Foo->new(); print $object->method();