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

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

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



stuckinarut
User

Jun 10, 2014, 6:09 PM


Views: 39097
Re: [stuckinarut] Modify script to compare and flag lists

After hours trying different things, I reverted to Bill's basic script and tried the only other thing I could thing of to get the flags to work but another dead end:


Code
#!/usr/bin/perl  
use strict;
use warnings;
my %H_list;
do {
open my $H_list, '<', 'listH.txt' or die "Cannot open xxxH.txt: $!";
my @temp = <$H_list>;
close $H_list;
@H_list{@temp} = 1 x scalar @temp;
};
my %A_list;
do {
open my $A_list, '<', 'listA.txt' or die "Cannot open xxxA.txt: $!";
my @temp = <$A_list>;
close $A_list;
@A_list{@temp} = 1 x scalar @temp;
};
open my $L_list, '<', 'listL.txt' or die "Cannot open xxxL.txt: $!";
while (<$L_list>) {
chomp;
print;
print ' H' if exists $H_list{$_} and $H_list{$_} == $L_list{$_};
print ' A' if exists $A_list{$_} and $A_list{$_} == $L_list{$_};
print "\n";
}


Completely stumped ;0(

- stuckinarut

P.S.

I also tried these lines:

((( EDIT: Oooops: I meant these...}}}


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



(This post was edited by stuckinarut on Jun 10, 2014, 11:19 PM)


Edit Log:
Post edited by stuckinarut (User) on Jun 10, 2014, 6:12 PM
Post edited by stuckinarut (User) on Jun 10, 2014, 6:16 PM
Post edited by stuckinarut (User) on Jun 10, 2014, 11:19 PM


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

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