Skip to content

Instantly share code, notes, and snippets.

@hakobe
Created October 15, 2008 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hakobe/16906 to your computer and use it in GitHub Desktop.
Save hakobe/16906 to your computer and use it in GitHub Desktop.
use strict;
use warnings;
package Puu;
use base qw( Class::Accessor::Lvalue::Fast);
__PACKAGE__->mk_accessors(qw(nyo nyu));
package main;
use Data::Dumper;
use Perl6::Say;
sub p($) {
say Dumper @_;
}
my $puu = Puu->new;
$puu->nyo = 1;
p $puu->nyo; # 1
$puu->nyo++;
p $puu->nyo; # 2
$puu->nyo += 1;
p $puu->nyo; # 3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment