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

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

551


What are the arguments and what do they mean in perl programming?

528


Explain string comparison operators in perl.

559


what is the difference between java and cgi?

563


How to compare two strings in perl?

551






“Perl regular expressions match the longest string possible”. What is the name of this match?

532


Which functions in perl allows you to include a module file. State their differences.

534


What is the use of '>>' in perl?

542


Explain subroutine?

534


Explain cpan?

539


Which has highest precedence in between list and terms? Explain?

444


How can arrays be tied?

521


Explain goto name?

530


How do I read command-line arguments with Perl?

605


For a situation in programming, how can you determine that Perl is a suitable?

486