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
Remove the duplicate data from @array=(“perl”,”php”,”perl”,”asp”)
Home
Perl
Remove the duplicate data from @array=(“perl”,”php”,”perl”,”asp”)
0
votes
asked
Jul 27, 2023
in
Perl
by
SakshiSharma
Remove the duplicate data from @array=(“perl”,”php”,”perl”,”asp”)
duplicate-perl
Please
log in
or
register
to answer this question.
1
Answer
0
votes
answered
Jul 27, 2023
by
SakshiSharma
sub uniqueentr
{
return keys %{{ map { $_ => 1 } @_ }};
}
@array = ("perl","php","perl","asp");
print join(" ", @array), "\n";
print join(" ", uniqueentr(@array)), "\n";
...