Skip to content

Instantly share code, notes, and snippets.

@rsimoes
Created February 22, 2012 14:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rsimoes/1885397 to your computer and use it in GitHub Desktop.
Save rsimoes/1885397 to your computer and use it in GitHub Desktop.
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