how to search a unique pattern in a file by using perl hash
map function ??? plz answer me

Answer Posted / vinod mishra

open(FH, "file");
@array = <FH>;
%seen = ();
@uniq = grep{!seen{$_}++} @array;

Is This Answer Correct ?    1 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the functioning of conditional structures in perl.

520


Explain the different types of data perl can handle.

549


Which of these is a difference between Perl and C++ ?

640


What are the different string manipulation operators in perl?

582


Which statement has an initialization, condition check and increment expressions in its body? Write a syntax to use that statement.

629






Perl regular expressions are greedy" what does this mean?

553


How would you ensure the re-use and maximum readability of your perl code?

590


What does 'do' statement do in perl?

553


Is perl a case sensitive language?

707


How to read file into hash array ?

635


Which operator in perl is used for the concatenation of two strings?

565


What is the use of -n and -p options?

658


what is Perl one liner?

592


How to connect to SQL server through Perl?

615


How do I print the entire contents of an array with Perl?

599