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: [CPS] Searching two-value hash array: Edit Log



CPS
Novice

Sep 20, 2012, 6:43 AM


Views: 2837
Re: [CPS] Searching two-value hash array

Ok,

I have modified code to the following. It looks better and works good.
Again thanks for the reply!

Code of the main loop:

Code
foreach $key (keys(%sum)) 
{
my @excludeList = split(",", $key);
$firstvalue = trim($excludeList[0]); # ip address
$secondvalue = trim($excludeList[1]); # ip address
$tempkey = "$secondvalue,$firstvalue";
$ip = &checkArray($secondvalue,$firstvalue);
if ($ip ne 666)
{
if (exists($sum{$tempkey}))
{
$arrayz[$othcnt] = $key;
$othcnt = $othcnt + 1;
my $tempvalue = $sum{$tempkey}; #keyx
print "$key,0,$sum{$key},0,$tempvalue\n";
}
else
{
print "$key,0,$sum{$key},0,0\n";

}
}
}



(This post was edited by CPS on Sep 20, 2012, 6:44 AM)


Edit Log:
Post edited by CPS (Novice) on Sep 20, 2012, 6:44 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