Thread: PERL to C#
View Single Post
Old 08-20-2004, 01:43 AM   #1 (permalink)
Draqos
Registered User
 
Draqos's Avatar
 
Join Date: Aug 2004
Posts: 2
Draqos is on a distinguished road
PERL to C#

Hi. I had to translate a PERL program to C# and I almost did it, though i'm having trouble understanding these lines bellow.
If someone could give me a pseudocode or point to a link where I can find explanation of the keywords used, I'd be eteranally gratefull

---------------- PERL CODE ------------

my @results = sort { $results{$a} <=> $results{$b} } keys %results;

print join("\n",map { "$_\t $results{$_}"; } @results),"\n" if $opt_v;

my $a = $results{$results[0]};
my @answers=(shift(@results));
while (@results && $results{$results[0]} < ($opt_u *$a)) {
@answers=(@answers,shift(@results));
}

---------------------------------------

To be more specific, I don't understand the sort, shift (these ones are really giving me headaches) and join statements.
Once again, if could spare 5 minutes, i'd very much apreciate it
Draqos is offline   Reply With Quote