Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@ktat
Created March 17, 2014 11:07
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 ktat/9597471 to your computer and use it in GitHub Desktop.
Save ktat/9597471 to your computer and use it in GitHub Desktop.
use Data::Delay;
my $test = 1;
my $data = Data::Delay->new(\$test);
print $data; # 1
$test = 2;
print $test; # 2
my $plus = Data::Delay->New(sub { $data + 2 });
print $plus; # 4
$test = -2;
print $plus; # 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment