#!/usr/bin/perl use strict; my %record; my $string = "{key_1 : value_1}{key_2 : value_2}{key_n : value_n}"; for ( map { split /\}/ } $string ) { $record{$1} = $2 if /\{(\w+)\s:\s(\w+)/; }
In reply to Re: converting a String to Hashtable
by bichonfrise74
in thread converting a String to Hashtable
by mc_prakash
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |