Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
my @array = [];
print "With []: \|@array\|\n";
my @array1 = ();
print "With (): \|@array1\|\n";
With []: |ARRAY(0x1abf0b4)|
With (): ||
To quibble, that's not quite true. @array is an array (not anonymous, it has a name) whose 1 element is a reference to an anonymous array. E.g.my @array = [] is an annoymous array
#!perl
use strict;
use warnings;
my @array = [];
print "With []: \|@array\|\n";
[b]print scalar(@array), "\n";[/b]
print "\n";
my @array1 = ();
print "With (): \|@array1\|\n";
[b]print scalar(@array1), "\n";[/b]
print "\n";
[b]my $aref = [];
print "With (): \|$aref\|\n";
print scalar(@$aref), "\n";[/b]
With []: |ARRAY(0x225084)|
1
With (): ||
0
With (): |ARRAY(0x225138)|
0