Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Long-winded linearly typed variables
#!/usr/bin/env perl
use strict;
use warnings;
use Data::Dump;
use Data::Alias "alias";
use Scalar::Util qw(weaken isweak);
my $foo = ["a".."z"];
alias my @bar = @$foo;
weaken $foo;
undef $foo;
dd \@bar; # ["a".."z"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.