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

Answers were Sorted based on User's Feedback



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

Answer / hemant

I did't got ur answer ..!!
Can u explain it a lil Bit ...

Is This Answer Correct ?    0 Yes 1 No

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

Answer / vinod mishra

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

Is This Answer Correct ?    1 Yes 6 No

Post New Answer

More CGI Perl Interview Questions

What is a perl references?

0 Answers  


Which guidelines by Perl modules must be followed?

0 Answers  


What syntax is used for grep() function?

0 Answers  


How to make the following assignment, as arrayreference assignment ? my $arr_ref='[1,2,3,4,4,'elem']';

2 Answers  


Explain perl. What are the advantages of programming in perl?

0 Answers  


What is the importance of perl warnings? How do you turn them on?

0 Answers  


How to find out the version of PERL being installed on your LINUX machine.

4 Answers   Mind Tree,


What does init 5 and init 0 do?

0 Answers  


List the files in current directory sorted by size ?

0 Answers  


What is the tk module?

0 Answers  


my @array=('data1','data2'); my @array1=('data1','data2'); my ($i,$k); $i=7; $k=7; while($i){ $array [++$#array] = 'ree'; $i--; print "@array"; } while($k){ push(@array1,'ree'); $k--; print "@array1"; } Are these two while loop are doing the same functionality ? What may be the difference?

2 Answers  


How will you access an element of a perl array?

0 Answers  


Categories