-sampath$x = 'ABCD----[this] fgab [that] AB CD EF -- [foo]'; $x =~ s/\s*([^\[]+?)\s*\-*\s*\[([^\]]+)\]/$myhash{$1} = $2;/ge; print Dumper(\%myhash);
2005-03-05 Janitored by Arunbear - added code tags, as per Monastery guidelines
In reply to Re: converting an arbitrary string into a hash based on a pattern
by ssk
in thread converting an arbitrary string into a hash based on a pattern
by punkish
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |