abidq has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's minimum standard of quality and will not be displayed.

Replies are listed 'Best First'.
Re: string value assignment
by GrandFather (Saint) on May 14, 2011 at 11:00 UTC

    How about you show us what you have tried? This has a rather homework look about it and despite that has lost a lot in translation. Without seeing the code you have tried already it's not at all clear where you are having trouble nor even what you are wanting to achieve.

    You'll find it helps to get help here if you provide a little sample data, the code you have written in an attempt to process the data and both the output you get and the output you expect.

    True laziness is hard work
    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: string value assignment
by Anonymous Monk on May 14, 2011 at 11:00 UTC
Re: string value assignment
by ciderpunx (Vicar) on May 14, 2011 at 11:14 UTC
    Its normally helpful if you post your code and describe what you are having difficulty with. But I'm at a loose end so try:
    #!/usr/bin/perl use warnings; use strict; open (IN, 'first.txt') or die ("crap! $!"); my @first = <IN>; close IN; open (IN, 'second.txt') or die ("crap! $!"); my @second = <IN>; close IN; my %h; my $i=0; for (@second) { ($h{'A'},$h{'B'},$h{'C'}) = split / /,$_; my @keys = split //,$first[$i]; my $total = 0; for(@keys) { $total+= int($h{$_}) unless /\n/; } $total/=scalar(@keys) if($total); print "$i: $total \n"; $i++; }


    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: string value assignment
by BrowserUk (Patriarch) on May 16, 2011 at 10:03 UTC

    What do you want at 3pm? And 7am?

      A lock-in till 3pm with the possibilty of going on till 7pm ;-)
        if they knew how t write progs ...wouldn't they first debug this weird website.