Bobby wrote: > > This is what i'm trying to accomplish. I want to be able to print the > equivalent EU to US sizes. For example in the flat file data, the US size 10 > has the equivalent of Euro 34, US 11=35 Euro. My idea was to put the US sizes > in a hash (%US) and the Euro in another hash (%EU) ; use the pid as the key > in both hashes, loop through and compare if key (pid) exists in both then > print the equivalent sizes $US{$us_size} - $EU{euro_size}. It seems easy > enough, but i think my syntax or use of hash is incorrect. > > pid|us_size|euro_size > 1|10|34 > 2|11|35 > 3|12|37 > 4|13|38
>From that it sounds like the values for PID are irrelevant and you simply need to relate each EU size with a US size. Are the Euro sizes also unique? Or can one Euro size have multiple US equivalents? The code snippet below may help. Rob my %eu_to_us; while (<DATA>) { my ($pid, $us, $eu) = split /\|/; $eu_to_us{$eu} = $us; } -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/