#!/usr/bin/perl use warnings; use strict; my (@lines,%hash); open (IN,"<data.txt") or die "cannot open file for reading: $!"; @lines = <IN>; close (IN) or die "cannot close file: $!"; foreach (@lines) { $_ =~ /(.*)\|(.*)\|/; $hash{$1} = $2; }
In reply to Re: Array values into hash
by primus
in thread Array values into hash
by FireBird34
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |