CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Intermediate: Re: [Laurent_R] Modify script to compare and flag lists: Edit Log


Jun 11, 2014, 12:55 AM

Views: 41998
Re: [Laurent_R] Modify script to compare and flag lists

In Reply To

    print ' H' if exists $H_list{$_} and $H_list{$_} == $L_list{$_};    
print ' A' if exists $A_list{$_} and $A_list{$_} == $L_list{$_};

You haven't shown your data, but since you called one of your original variables $letter, I assume that you are not dealing with numbers, but with alphanumerical data. In this case, the "==" operator is not what you need (this is only for comparing numbers), try the "eq" operator instead.

Otherwise, I was going to provide some code, but figured out it would not be sunstantially different from Bill's proposal. I would therefore suggest that you state in which respect the code supplied by Bill does not fit your purpose, so that a change to his code may be proposed.

I further edited the 2 lines above, and have spent hours trying different attempts to match the H & A ID's to any on the L list without success.

As earlier indicated, Bill's code works to read all the data files in, but the problem is none of the H or A flags show up in the final output.

I also tried two foreach loops within the while loop - one for H and one for A but nil.

The latest effort after trying many others a few minutes ago:

print ' H' if exists $H_list{$_} and $_ eq chomp( $L_list);
print ' A' if exists $A_list{$_} and $_ eq chomp($L_list);

Yes, the ID's are (as initially stated), alpha-numeric BUT may contain a "/" forward slash as also indicated earlier.

At this point I will manually pre-sort each of the lists BEFORE running the script to keep things as simple as possible trying to figure how HOW ON EARTH to match any ID's on the H and/or A list to the L list.

I am mentally burned out at this point ;-(

- stuckinarut

(This post was edited by stuckinarut on Jun 11, 2014, 12:57 AM)

Edit Log:
Post edited by stuckinarut (User) on Jun 11, 2014, 12:57 AM

Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives