in reply to Re^6: Unclear about 'our'
in thread Unclear about 'our'

Perl OO, at its simplest, actually doesn't involve that much boilerplate so that IMHO it's worth it to learn that - see my example below as well as perlootut and perlmod (Update: and perlobj). But when I do use a module, I typically go for Moo.

package Foo; use warnings; use strict; sub new { my ($class, $bar) = @_; my $self = { bar => $bar }; return bless $self, $class; } sub foo { my $self = shift; print "Bar=", $self->{bar}, "\n"; } 1;