Question:

If you want to empty an array then how would you do that?

Answer:

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";
 
}

 


Keywords:

© 2017 QuizBucket.org