Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Hi choroba,

Thank you for your suggestions and prompt reply. My problem appears to be solved. Your last sentence (question) has been very constructive and ignited my thinking. It has helped me to sort out the problem. I have corrected the script and it goes as follows. I am grateful to you.

With regards,

Here goes the code

#!/usr/bin/perl use warnings; use List::Compare; # Use of module @x= qw/a b/; @y= qw/a c/; @z= qw/a d/; push @s,\@x,\@y,\@z; $num_ele=@s; print "\n Array s: @s\n No. of Elements: $num_ele\n"; $all= List::Compare->new(@s); # module @unq_x=$all->get_unique(0); @unq_y=$all->get_unique(1); @unq_z=$all->get_unique(2); print " unq_x: @unq_x\n unq_y: @unq_y\n unq_z: @unq_z\n\n"; exit;

The results of are (correct):

C:\Users\x\Desktop> Array s: ARRAY(0x320b14) ARRAY(0x320b64) ARRAY(0x3305d4) No. of Elements: 3 unq_x: b unq_y: c unq_z: d

In reply to Re^2: How can one find unique elements from arrays using a LOOP? by supriyoch_2008
in thread How can one find unique elements from arrays using a LOOP? by supriyoch_2008

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

  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (7)
As of 2024-05-18 22:04 GMT
Find Nodes?
    Voting Booth?

    No recent polls found