As Corion has answered your question, here's just a simpler (IMHO) approach to the task:
#!/usr/bin/env perl use strict; use warnings; use Data::Dumper; my $s = "1 A\n2 B\n"; my %h = split /\s/, $s; print Dumper(\%h);
In reply to Re: regex question
by hippo
in thread regex question
by morgon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |