Yes, you can do this, but no, you should not do this.
What you should do instead is use an array of references to anonymous arrays:
@arrayrefs = ();
$i = 0;
while ($i <= 5) {
$arrayrefs[$i] = [];
$i++;
}
or, more tersely:
@arrayrefs = ([], [], [], [], [], []);
But for completeness' sake . . . you can do this, by using "symbolic references":
$i = 0;
while ($i <= 5) {
my $name = "array$i";
@$name = ();
$i++;
}
(of course, arrays default to the empty array anyway, so this isn't really needed . . .).
By the way, note that it's actually customary to use a for loop rather than a while loop for such simple cases. Either this:
for ($i = 0; $i <= 5; $i++) {
...
}
or this:
for $i (0 .. 5) {
...
}