Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 488
  • Last Modified:

Anagram in perl

I want to create a perl anagramm program that reads a name (eg andrew) from an externel file (eg names.txt) and prints out the possible word combinations! Do I have to create an array?
Can somebody please help?
0
andreafp
Asked:
andreafp
  • 2
2 Solutions
 
davorgCommented:
You can split a string into an array like this:

my @array = split //, $string;

You can then use the "shuffle" function (from List::Util) to get an anagram.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now