Comparing two strings for Anagram using hash [closed]Secure hash and salt for PHP passwordsHow can I generate an MD5 hash?Generate a Hash from string in JavascriptFinding anagrams for a given wordBug in the program for finding two strings are anagram or notAnagram-compare two stringsmake two strings anagramsChecking if two strings are anagramFind all anagram in a string how to optimize

Why can my keyboard only digest 6 keypresses at a time?

Moving points closer to polyline using ModelBuilder?

Is it legal for a bar bouncer to confiscate a fake ID

Why was this person allowed to become Grand Maester?

Bb13b9 confusion

How to safely destroy (a large quantity of) valid checks?

Why does logistic function use e rather than 2?

sed + add word before string only if not exists

Is it safe to change the harddrive power feature so that it never turns off?

A map of non-pathological topology?

Does the new finding on "reversing a quantum jump mid-flight" rule out any interpretations of QM?

How to ensure color fidelity of the same file on two computers?

Has there been a multiethnic Star Trek character?

Is it a bad idea to to run 24 tap and shock lands in standard

Who enforces MPAA rating adherence?

Russian word for a male zebra

CSV how to trim values to 2 places in multiple columns using UNIX

How to handle (one's own) self-harm scars (on the arm), in a work environment?

Determining fair price for profitable mobile app business

LuaLaTex - how to use number, computed later in the document

What ways have you found to get edits from non-LaTeX users?

Wooden cooking layout

How can I end combat quickly when the outcome is inevitable?

Generate basis elements of the Steenrod algebra



Comparing two strings for Anagram using hash [closed]


Secure hash and salt for PHP passwordsHow can I generate an MD5 hash?Generate a Hash from string in JavascriptFinding anagrams for a given wordBug in the program for finding two strings are anagram or notAnagram-compare two stringsmake two strings anagramsChecking if two strings are anagramFind all anagram in a string how to optimize






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








-5















I'm new to perl. Can anyone give an example to a perl code for detecting anagram between to given strings using hash's. two strings - pool and polo.










share|improve this question













closed as off-topic by Stefan Becker, melpomene, Andy Lester, Dave Cross, Håkon Hægland Mar 24 at 22:38


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – Stefan Becker, melpomene, Andy Lester, Dave Cross, Håkon Hægland
If this question can be reworded to fit the rules in the help center, please edit the question.
















  • See also Word::Anagram and rosetta code: anagrams

    – Håkon Hægland
    Mar 24 at 19:22












  • Much appreciate for your help. rosetta code: anagrams seems to be complicate for me to understand. can you show me some source with basic syntax.

    – Pasupuleti Vinaykumar
    Mar 24 at 19:45











  • You are welcome. The rosetta code looks quite simple, please explain what part of the code you do not understand. You could also take a look at the source code of the Word::Anagram module. You can find it here

    – Håkon Hægland
    Mar 24 at 19:50


















-5















I'm new to perl. Can anyone give an example to a perl code for detecting anagram between to given strings using hash's. two strings - pool and polo.










share|improve this question













closed as off-topic by Stefan Becker, melpomene, Andy Lester, Dave Cross, Håkon Hægland Mar 24 at 22:38


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – Stefan Becker, melpomene, Andy Lester, Dave Cross, Håkon Hægland
If this question can be reworded to fit the rules in the help center, please edit the question.
















  • See also Word::Anagram and rosetta code: anagrams

    – Håkon Hægland
    Mar 24 at 19:22












  • Much appreciate for your help. rosetta code: anagrams seems to be complicate for me to understand. can you show me some source with basic syntax.

    – Pasupuleti Vinaykumar
    Mar 24 at 19:45











  • You are welcome. The rosetta code looks quite simple, please explain what part of the code you do not understand. You could also take a look at the source code of the Word::Anagram module. You can find it here

    – Håkon Hægland
    Mar 24 at 19:50














-5












-5








-5


0






I'm new to perl. Can anyone give an example to a perl code for detecting anagram between to given strings using hash's. two strings - pool and polo.










share|improve this question














I'm new to perl. Can anyone give an example to a perl code for detecting anagram between to given strings using hash's. two strings - pool and polo.







perl hash anagram






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Mar 24 at 19:11









Pasupuleti VinaykumarPasupuleti Vinaykumar

1




1




closed as off-topic by Stefan Becker, melpomene, Andy Lester, Dave Cross, Håkon Hægland Mar 24 at 22:38


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – Stefan Becker, melpomene, Andy Lester, Dave Cross, Håkon Hægland
If this question can be reworded to fit the rules in the help center, please edit the question.







closed as off-topic by Stefan Becker, melpomene, Andy Lester, Dave Cross, Håkon Hægland Mar 24 at 22:38


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Questions asking us to recommend or find a book, tool, software library, tutorial or other off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it." – Stefan Becker, melpomene, Andy Lester, Dave Cross, Håkon Hægland
If this question can be reworded to fit the rules in the help center, please edit the question.












  • See also Word::Anagram and rosetta code: anagrams

    – Håkon Hægland
    Mar 24 at 19:22












  • Much appreciate for your help. rosetta code: anagrams seems to be complicate for me to understand. can you show me some source with basic syntax.

    – Pasupuleti Vinaykumar
    Mar 24 at 19:45











  • You are welcome. The rosetta code looks quite simple, please explain what part of the code you do not understand. You could also take a look at the source code of the Word::Anagram module. You can find it here

    – Håkon Hægland
    Mar 24 at 19:50


















  • See also Word::Anagram and rosetta code: anagrams

    – Håkon Hægland
    Mar 24 at 19:22












  • Much appreciate for your help. rosetta code: anagrams seems to be complicate for me to understand. can you show me some source with basic syntax.

    – Pasupuleti Vinaykumar
    Mar 24 at 19:45











  • You are welcome. The rosetta code looks quite simple, please explain what part of the code you do not understand. You could also take a look at the source code of the Word::Anagram module. You can find it here

    – Håkon Hægland
    Mar 24 at 19:50

















See also Word::Anagram and rosetta code: anagrams

– Håkon Hægland
Mar 24 at 19:22






See also Word::Anagram and rosetta code: anagrams

– Håkon Hægland
Mar 24 at 19:22














Much appreciate for your help. rosetta code: anagrams seems to be complicate for me to understand. can you show me some source with basic syntax.

– Pasupuleti Vinaykumar
Mar 24 at 19:45





Much appreciate for your help. rosetta code: anagrams seems to be complicate for me to understand. can you show me some source with basic syntax.

– Pasupuleti Vinaykumar
Mar 24 at 19:45













You are welcome. The rosetta code looks quite simple, please explain what part of the code you do not understand. You could also take a look at the source code of the Word::Anagram module. You can find it here

– Håkon Hægland
Mar 24 at 19:50






You are welcome. The rosetta code looks quite simple, please explain what part of the code you do not understand. You could also take a look at the source code of the Word::Anagram module. You can find it here

– Håkon Hægland
Mar 24 at 19:50













1 Answer
1






active

oldest

votes


















1














sub key(_) join "", sort split //, $_[0] 

if (key("pool") eq key("polo")
say "Pool and polo are anagrams of each other.";
else
say "Pool and polo aren't anagrams of each other.";



If you had a dictionary,



sub key(_) join "", sort split //, $_[0] 

my $dict_qfn = "...";
my $search = "pool";

my %anagrams;

open(my $fh, '<', $dict_qfn)
or die("Can't open "$dict_qfn": $!n");

while (<$fh>)
chomp;
push @ $anagrams key($_) , $_;



my @results = grep $_ ne $search @ $anagrams$search // [] ;
say "Anagrams of $search: ".( @results ? "@results" : "[none]" );





share|improve this answer

























  • Any particular reason for using (_)? (since you still write key($_)) Just feeling like using prototypes lately, or ... ?

    – Dada
    Mar 24 at 22:57











  • @Dada, I'm not taking advantage of it, but it's exactly the kind of function where the prototype could be useful

    – ikegami
    Mar 24 at 23:21


















1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














sub key(_) join "", sort split //, $_[0] 

if (key("pool") eq key("polo")
say "Pool and polo are anagrams of each other.";
else
say "Pool and polo aren't anagrams of each other.";



If you had a dictionary,



sub key(_) join "", sort split //, $_[0] 

my $dict_qfn = "...";
my $search = "pool";

my %anagrams;

open(my $fh, '<', $dict_qfn)
or die("Can't open "$dict_qfn": $!n");

while (<$fh>)
chomp;
push @ $anagrams key($_) , $_;



my @results = grep $_ ne $search @ $anagrams$search // [] ;
say "Anagrams of $search: ".( @results ? "@results" : "[none]" );





share|improve this answer

























  • Any particular reason for using (_)? (since you still write key($_)) Just feeling like using prototypes lately, or ... ?

    – Dada
    Mar 24 at 22:57











  • @Dada, I'm not taking advantage of it, but it's exactly the kind of function where the prototype could be useful

    – ikegami
    Mar 24 at 23:21
















1














sub key(_) join "", sort split //, $_[0] 

if (key("pool") eq key("polo")
say "Pool and polo are anagrams of each other.";
else
say "Pool and polo aren't anagrams of each other.";



If you had a dictionary,



sub key(_) join "", sort split //, $_[0] 

my $dict_qfn = "...";
my $search = "pool";

my %anagrams;

open(my $fh, '<', $dict_qfn)
or die("Can't open "$dict_qfn": $!n");

while (<$fh>)
chomp;
push @ $anagrams key($_) , $_;



my @results = grep $_ ne $search @ $anagrams$search // [] ;
say "Anagrams of $search: ".( @results ? "@results" : "[none]" );





share|improve this answer

























  • Any particular reason for using (_)? (since you still write key($_)) Just feeling like using prototypes lately, or ... ?

    – Dada
    Mar 24 at 22:57











  • @Dada, I'm not taking advantage of it, but it's exactly the kind of function where the prototype could be useful

    – ikegami
    Mar 24 at 23:21














1












1








1







sub key(_) join "", sort split //, $_[0] 

if (key("pool") eq key("polo")
say "Pool and polo are anagrams of each other.";
else
say "Pool and polo aren't anagrams of each other.";



If you had a dictionary,



sub key(_) join "", sort split //, $_[0] 

my $dict_qfn = "...";
my $search = "pool";

my %anagrams;

open(my $fh, '<', $dict_qfn)
or die("Can't open "$dict_qfn": $!n");

while (<$fh>)
chomp;
push @ $anagrams key($_) , $_;



my @results = grep $_ ne $search @ $anagrams$search // [] ;
say "Anagrams of $search: ".( @results ? "@results" : "[none]" );





share|improve this answer















sub key(_) join "", sort split //, $_[0] 

if (key("pool") eq key("polo")
say "Pool and polo are anagrams of each other.";
else
say "Pool and polo aren't anagrams of each other.";



If you had a dictionary,



sub key(_) join "", sort split //, $_[0] 

my $dict_qfn = "...";
my $search = "pool";

my %anagrams;

open(my $fh, '<', $dict_qfn)
or die("Can't open "$dict_qfn": $!n");

while (<$fh>)
chomp;
push @ $anagrams key($_) , $_;



my @results = grep $_ ne $search @ $anagrams$search // [] ;
say "Anagrams of $search: ".( @results ? "@results" : "[none]" );






share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 25 at 21:49

























answered Mar 24 at 20:02









ikegamiikegami

272k11184413




272k11184413












  • Any particular reason for using (_)? (since you still write key($_)) Just feeling like using prototypes lately, or ... ?

    – Dada
    Mar 24 at 22:57











  • @Dada, I'm not taking advantage of it, but it's exactly the kind of function where the prototype could be useful

    – ikegami
    Mar 24 at 23:21


















  • Any particular reason for using (_)? (since you still write key($_)) Just feeling like using prototypes lately, or ... ?

    – Dada
    Mar 24 at 22:57











  • @Dada, I'm not taking advantage of it, but it's exactly the kind of function where the prototype could be useful

    – ikegami
    Mar 24 at 23:21

















Any particular reason for using (_)? (since you still write key($_)) Just feeling like using prototypes lately, or ... ?

– Dada
Mar 24 at 22:57





Any particular reason for using (_)? (since you still write key($_)) Just feeling like using prototypes lately, or ... ?

– Dada
Mar 24 at 22:57













@Dada, I'm not taking advantage of it, but it's exactly the kind of function where the prototype could be useful

– ikegami
Mar 24 at 23:21






@Dada, I'm not taking advantage of it, but it's exactly the kind of function where the prototype could be useful

– ikegami
Mar 24 at 23:21






Popular posts from this blog

Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript