Skip to content

Instantly share code, notes, and snippets.

@NicolaiNebel
Created February 22, 2019 12:16
Show Gist options
  • Save NicolaiNebel/9f0190e836e3e298f162e55c32679975 to your computer and use it in GitHub Desktop.
Save NicolaiNebel/9f0190e836e3e298f162e55c32679975 to your computer and use it in GitHub Desktop.
# $xs->@* basically means dereference $xs as a list
my $xs = [1,2,3];
push($xs->@*, 4);
say $xs->@*; # This prints 1234
# That is, 4 is pushed onto the ned of the array
$xs = [1,2,3];
my @list = $xs->@*;
push(@list, 4);
say $xs->@*; # This prints 123
# AAAAARGH
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment