### Re: reference problem

 on Jan 09, 2003 at 14:24 UTC ( #225546=note: print w/replies, xml ) Need Help??

Solved it I think:
```use strict;

use Tie::IxHash;

{
tie( my %csv, 'Tie::IxHash',

'one'   => undef,
'two'   => undef,
'three' => undef,
'four' => undef,
'five' => undef,
);
\$csv{one} = "11";
\$csv{two} = "12";
\$csv{three} = "13";
\$csv{four} = "14";
\$csv{five} = "15";

}

{
tie( my %csv, 'Tie::IxHash',

'one'   => undef,
'two'   => undef,
'three' => undef,
'four' => undef,
'five' => undef,
);
\$csv{one} = "11";
\$csv{three} = "23";
\$csv{four} = "14";
\$csv{five} = "25";

}

{
tie( my %csv, 'Tie::IxHash',

'one'   => undef,
'two'   => undef,
'three' => undef,
'four' => undef,
'five' => undef,
);

\$csv{one} = "31";
\$csv{two} = "12";
\$csv{three} = "23";
\$csv{five} = "25";

my \$match = "2";

while (my (\$k,\$v) = each %login) {
if (\$k eq \$match) {
my %union;
print "MATCH\n";
while ( my (\$k, \$v) = each %\$v ) { \$union{\$k} = \$v; }
while ( my (\$k, \$v) = each %csv ) { \$union{\$k} = \$v; }
print map{\$_ ."=". \$union{\$_} ."\n"} keys %union;
} else {
print "NO MATCH\n";
while ( my (\$k, \$v) = each %\$v ) { print \$k ."=". \$v."\n"; }
}

}
}
Mhh the union part doesn't work like i want to. Empty elements in it?
Off course suggestions howto improve the rest of the code are also welcome!!

--
My opinions may have changed,
but not the fact that I am right

Create A New User
Node Status?
node history
Node Type: note [id://225546]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (12)
As of 2017-11-23 15:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
In order to be able to say "I know Perl", you must have:

Results (336 votes). Check out past polls.

Notices?