- or download this
Named Anonymous
@array []
%hash {}
- or download this
@array;
- or download this
[];
- or download this
$arrayref = [];
- or download this
$ary = $arrayref;
push @$ary,"foo";
print $arrayref->[0]; # prints "foo" \
print @$arrayref[0]; # prints "foo" - same pointer value in $ary and
+$arrayref
print $ary->[0]; # prints "foo" /
- or download this
for("foo") {
print; # prints foo
undef $_; # dies with "Modification of a read-only value attempte
+d"
# - literals cannot be modified
}
- or download this
my $ref = ["my","list"];
- or download this
for (@$ref) {
print;
$_ = undef;
}
# the [] array pointed to with the content of $ref is now [undef,undef
+]