It solves Erudil's find-a-func, type something like:
./find-a-func.pl | ./perl-monk.pl

if the d/l code doesn't work, try here
#!/usr/bin/perl use strict; print "\nSaid the Llama to the Lama:\n"; my (@Llama, %answers, @llama, @questions) = map{ print;$_ +}(<>); die "seeking a llama to share pipe!\n" unless $Llama[0]=~/ +Find/; print "\nSaid the Lama to the Llama:\n"; my$karma=0 ;for ( @Llama ){chomp; ; chomp; s/Fi/Fou/;s/-/--/; ;/ /; my ( $lama, $llama ) = ($`,$'); s/ //g for( $lama , $llama); $|=0;push @questions,$llama unless $llama=~ /^$/ ; push @llama,# $lama unless $lama=~ /^$/} %answers = map { $_ , 0, scalar reverse( split // ) ,0 }@questions;my @karma=llama( @llama);my @dharma = llama(map { ( ' ') x $_ . $llama[$_]. (' ') x (1* $#llama -$_)}(0..$#llama)); my @lama=map{$a = $_;;;;; s/( *)(\w+)( *)/$3$2$1/; $a}@dharma; my %find = (lama => \@llama,dharma =>\@karma,karma =>\@dharma ,llama=> \@lama); sub llama{map{$|++; my $grazing= $_ ;join( '', map{ ( split //,$_[ $_ ]) [$grazing] } (0..$#_ ))}(0.. ( length($_[0])-1))}sub dharma{m +y @llama = @{$_[0]} ;[map{s/[a-z]/\*/g;; ; $_}@llam +a ] };; my %llama= map{$_,dharma($find{$_}) } ( ke +ys %find );; sub karma { my $reasons=shift ;; ; ; +my @answers = @{ $find{ "$reasons" } };; for my $questions (keys%answers){next if $answers{ $question +s }; study $questions;for (0.. $#answers ) { if ( $answers[ $_]=~/$questions/){my($soul ,$seeks , $to_know )=($`,$' ,$&) ;s/\w/\*/g for ($seeks, $to +_know, $soul);$llama{ $reasons} ->[$_]=$soul . $questions .$seek +s;$karma ++;$answers{ $questions} ++ ; $answers{ reverse( split//,$ +to_know)}++ }}}};for(keys %find){ karma($_ )};my@dali =map{$a= $_;$a=~s/ +./\*/g;$a} (@llama); for my $karma(keys %llama){ $llama {$karma} +=[ llama( @{$llama{$karma}})] if $karma=~/.{5}/ ;for(0 .. $#{$llama{$ +karma}}){ $llama{$karma}->[$_] =~s/ //g;my@Lama =split//, $dali[$_];my +@lAma= split//,$llama{$karma}->[$_];$dali[$_]= join('',map{($lAma +[$_] ne '*') ? $lAma[$_]:$Lama[$_]}(0..$#lAma));}}my @answer=map { s/ +(.)/$1 /g ;s/\*/ /g; ($_,' 'x(length($_)))}(@dali);my($llama,$lama)=sort($#qu +estions, $#answer) ; for (0..$lama) {print $answer[$_]," ",$questions[$_ +],"\n" }



Updated:It was written for Perl 5.6.1 where "my $karma++" works
I've changed that to "my $karma=0" in the hope it works for earlier verions ... profound really ;)

Thanks to Erudil,virtualsue,monkfish and marvell for checking this out. I'll be less impatient next time.

--

Brother Frankus.

¤


In reply to It's a perlmonk. by frankus

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.