我的字符串如下,我想删除第一个 { ,只有第一个是字符串的开头。该字符串在替换之前打印良好,但在替换它的空字符串之后。
use strict;
use warnings;
my $string = {"something":[{"some":"12","some":"something","data":"","data":"data2","age":"23"},{......},{.....}]}
# the string is valid as it is json from some array function.
print $string."\n"; #My string prints fine here
$string = s/\{//;
print "String after replacement".".$string." testing";