You could enter the data directly into a hash, below is an example which seem to match the approach you have been trying.
use strict; my %calhash; while (<OUTFILE>) { # Should be <INFILE> ?? chomp; my ($value, $key) = split(/;/, $_); $calhash{$key} = $value; }
Of course this requires that you are guaranteed that there is only one semicolon in each line. Otherwise you will have to use a regexp.
---In reply to Re: How to assign a hash from an array?
by guha
in thread How to assign a hash from an array?
by jamen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |