Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

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 try5.pl (given below) in cmd several times but it gave the wrong results like:

Here goes the script try5.pl

#!/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 try5.pl in cmd: C:\Users\DR SUPRIYO>cd desktop C:\Users\DR SUPRIYO\Desktop>try5.pl 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 +.pl line 4 Compilation failed in require at C:\Users\DR SUPRIYO\Desktop\try5.pl 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 try5.pl in my computer.


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

Title:
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!
  • 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?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others taking refuge in the Monastery: (4)
    As of 2015-07-28 05:57 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









      Results (252 votes), past polls