$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"; }