$content=~ s/\n\+//sg; $content =~ s/--/00.00/g; my @array1 = split (/(\+?-?\d+\.\d+)/,$content); my @array2; foreach(@array1) { $_ =~ s/^\s+//; push (@array2,$_); } my %hash = @array2; foreach (keys %hash) { $hash{$_} = "--" if ($hash{$_} =~ m/00\.00/); print "$_ => $hash{$_}\n"; }
Try this code, it worked for me.
In reply to Re: Words and Numbers to hash
by simmisam
in thread Words and Numbers to hash
by mrras25
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |