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

Perl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
usestrict;
 
usewarnings;
 
my@checkarray;
 
if(@checkarray)
 
{
 
print"Array is not empty";
 
}
 
else
 
{
 
print"Array is empty";
 
}

All perl Questions

Ask your interview questions on perl

Write Your comment or Questions if you want the answers on perl from perl Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---