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

Differentiate between use and require, my and local, for and foreach and exec and system

653


Explain regular expression in perl?

707


What are the options that can be used to avoid logic errors in perl?

695


What are the various file operations in perl. Explain with example.

688


What are arrays in perl?

729


Explain cpan?

707


What is a chomp() function in perl?

713


explain the various functions/directives in perl that allow you to include/import a module. Also, state the differences between them.

622


What is hash?

702


What syntax is used for grep() function?

768


What is stdin in perl?

707


Write the program to process a list of numbers.

641


How to convert strings into an array in perl?

696


When would `local $_' in a function ruin your day?

713


How can we create perl programs in unix, windows nt, macintosh and os/2 ?

655