in reply to Objected oriented perl with attributes in methods?

The first argument passed to a method is the invocant. The "hash" is passed as a list, but you can copy it to a hash:
sub fold { my $self = shift; my %options = @_; if ($options{-style} eq 'prion') { # ... } }
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Replies are listed 'Best First'.
Re^2: Objected oriented perl with attributes in methods?
by Anonymous Monk on May 31, 2013 at 20:00 UTC
    Thanks choroba!

    I completely forgot that the '=>' is simply a comma and what I initially thought was a hash was actually a list.
    Thanks again for the help.