Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
sub-clone fits now
  • Loading branch information
Brad Bowman committed Feb 4, 2012
1 parent e777211 commit 3268ecb
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions snippets/sub-clone.pl
@@ -1,9 +1,6 @@
use Sub::Clone;
sub get_callback { return sub { "hi!" }; }

my $first = get_callback();
my $second = get_callback();
my $first = get_callback(); my $second = get_callback();
my $third = clone_sub $second;

warn "$first == $second"; # prints the same refaddr
warn "$third != $second"; # prints the diff refaddr
print "# $first == $second\n"; # same refaddr
print "# $third != $second\n"; # diff refaddr

0 comments on commit 3268ecb

Please sign in to comment.