Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer

Comment on

( #3333=superdoc: print w/replies, xml ) Need Help??

Hi PerMonks,

I have come across a perl module i.e. Algorithm::Permute which can find out the permutations of r elements of n where r<n. I have installed the Algorithm from cpan writing the text on cmd as "cpan Algorithm::Permute" and then pressing "enter". I got the following results:

Results about Algorithm::Permute Installation: Microsoft Windows [Version 6.1.7600] Copyright (c) 2009 Microsoft Corporation. All rights reserved. C:\Users\DR SUPRIYO>cpan Algorithm::Permute Set up gcc environment - 3.4.5 (mingw-vista special r3) Going to read 'C:\Perl\cpan\Metadata' Database was generated on Tue, 26 Feb 2013 12:07:54 GMT Algorithm::Permute is up to date (0.12).

Then I tried to run the script (given below) in cmd several times but it gave the wrong results like:

Here goes the script

#!/usr/bin/perl use warnings; use strict; use Algorithm::Permute; my @a=qw/ A B C /; # You can create r of n objects permutation generator, where r <= n my $p=new Algorithm::Permute(@a,2); while (@res = $p->next) { print join(", ", @res), "\n"; } exit; # Script ends here
RESULTS of in cmd: C:\Users\DR SUPRIYO>cd desktop C:\Users\DR SUPRIYO\Desktop> Can't locate loadable object for module Algorithm::Permute in @INC (@I +NC contain s: C:/Perl/site/lib C:/Perl/lib .) at C:\Users\DR SUPRIYO\Desktop\try5 line 4 Compilation failed in require at C:\Users\DR SUPRIYO\Desktop\ l +ine 4. BEGIN failed--compilation aborted at C:\Users\DR SUPRIYO\Desktop\try5. +pl line 4. C:\Users\DR SUPRIYO\Desktop>

BrowserUK suggested some code on 26 February 2013 but I find it very difficult to understand right from the beginning. I am little acuainted with #!/usr/bin/perl and not with others. That is why I am now trying with Algorithm::Permute module to solve the problem. I am looking forward to suggestions from PerlMonks to fix the problem of in my computer.

In reply to How can I fix the problem in using the Algorithm::Permute module? by supriyoch_2008

Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":

  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?

    What's my password?
    Create A New User
    and all is quiet...

    How do I use this? | Other CB clients
    Other Users?
    Others chanting in the Monastery: (4)
    As of 2018-02-26 00:16 GMT
    Find Nodes?
      Voting Booth?
      When it is dark outside I am happiest to see ...

      Results (315 votes). Check out past polls.