There are some duplicate entries in an array and you want to remove them. How would you do that?



There are some duplicate entries in an array and you want to remove them. How would you do that?..

Answer / Nitin Banshi

In Perl, to remove duplicates from an array, you can use the 'uniq' function from the 'List::MoreUtils' module, or sort the array and compare consecutive elements using a 'while' loop.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More CGI Perl Interview Questions

Enlist the advantages of using c over perl?

1 Answers  


What are the purpose of close(), getc() and read() functions?

1 Answers  


What is perl shift array function?

1 Answers  


What is the usage of -i and 0s options?

1 Answers  


How are parameters passed to subroutines in perl?

1 Answers  


Can inheritance be used in perl? Explain with the help of an example.

1 Answers  


Name an instance where you used a CPAN module?

3 Answers   IBM, TCS,


What is the peculiarity of returning values by subroutines in perl?

1 Answers  


How do I read command-line arguments with Perl?

1 Answers  


How to get help for perl?

1 Answers  


Write a script to reverse a string without using perl's built in functions?

1 Answers  


What $! In perl?

1 Answers  


Categories