You can assign it to a hash using split.
my $text = "pro my project con my customer date 2009-10-5 at 17:00 pri + 2 msg Rack new server"; my @list = split /(pro|con|date|at|pri|msg)\s/, $text; shift @list; my %hash = @list; foreach(sort keys %hash) { printf "$_, %s\n", $hash{$_} }
In reply to Re: parsing data pairs from single line
by mickep76
in thread parsing data pairs from single line
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |