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

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.

Replies are listed 'Best First'.
Re^3: What does arrow (->) refer to?
by kennethk (Abbot) on Dec 01, 2009 at 18:06 UTC
    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();