Excuse me for my mis-understanding. Can you clarify? What is special about "kill-v"?
#!/usr/bin/perl -w use strict; use Data::Dumper; use Data::Dump qw (pp); my %animals; my %verbs; # Your say, "In the example above, the only feat that occurs # both with beast and frog is kill-v". # # I don't see it # Obviously there is something that I don't understand... # # this simple code gets multiple things in common # I don't understand how to filter out "see-v" and "turn-v" # Prints: # turn-v: beast-n frog-n # see-v: beast-n frog-n # kill-v: beast-n frog-n while (<DATA>) { my ($animal, $verb) = (split(' ', $_))[1,3]; $animals{$animal}++; push @{$verbs{$verb}}, $animal; } foreach my $verb (keys %verbs) { if (@{$verbs{$verb}} > 1) { print "$verb: @{$verbs{$verb}}", "\n"; } } __DATA__ 1 beast-n into transform-v 356.9551 2 beast-n obj kill-v 266.2511 3 beast-n obj see-v 252.3623 4 beast-n prd become-v 250.9534 5 beast-n obj tame-v 224.6948 6 beast-n into turn-v 191.9883 7 beast-n obj call-v 171.4000 8 beast-n sbj_intr devour-v 165.3228 9 beast-n obj hunt-v 155.7637 10 beast-n obj fight-v 150.4370 11 beast-n obj slay-v 150.3982 1 frog-n obj find-v 322.5589 2 frog-n into turn-v 307.3012 3 frog-n sbj_intr jump-v 235.0503 4 frog-n coord-1 toad-n 207.3611 5 frog-n obj see-v 207.2610 6 frog-n obj eat-v 204.1762 7 frog-n obj kill-v 64.6689

In reply to Re: Nested Cycle - Statistic measure by Marshall
in thread Nested Cycle - Statistic measure by remluvr

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!
  • 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, details, 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, summary, 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.