Home
Recent Q&A
Java
Cloud
JavaScript
Python
SQL
PHP
HTML
C++
Data Science
DBMS
Devops
Hadoop
Machine Learning
Azure
Blockchain
Devops
Ask a Question
If you want to empty an array then how would you do that?
Home
Perl
If you want to empty an array then how would you do that?
0
votes
asked
Jul 26, 2023
in
Perl
by
rahuljain1
If you want to empty an array then how would you do that?
perl
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
Jul 26, 2023
by
rahuljain1
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";
}
...