in reply to Using hash elements to create a string
%hash = ( "view0" => [qw/buffersize size value/], "view1" => [qw/buffersize size value/], "view2" => [qw/buffersize size value/], "view3" => [qw/buffersize size value/]); my $lastview; my $output; foreach $key (sort(keys %hash)){ # Do this only the first time. if(not defined($lastview)){ $lastview = $key; $output = "$key"; next; } $output .= " full outer join $key on $lastview.$hash{$lastview}[1] + = $key.$hash{$key}[1] and $lastview.$hash{$lastview}[0] = $key.$hash +{$lastview}[0]"; $lastview = $key; } print $output, "\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Using hash elements to create a string
by johnirl (Monk) on Sep 10, 2002 at 13:17 UTC | |
by RollyGuy (Chaplain) on Sep 10, 2002 at 14:53 UTC | |
by johnirl (Monk) on Sep 11, 2002 at 08:30 UTC | |
by RollyGuy (Chaplain) on Sep 11, 2002 at 13:40 UTC |