use strict; use warnings; use Data::Dumper; my $string = "1:one;2:two;3:three"; my %hash = split /[;:]/, $string; print Dumper \%hash;