0 votes
in Perl by
If you want to empty an array then how would you do that?

1 Answer

0 votes
by
We can empty an array by setting its length to any –ve number, generally -1 and by assigning null list

use strict;

use warnings;

my @checkarray;

if (@checkarray)

{

print "Array is not empty";

}

else

{

print "Array is empty";

}
...