我的字符串如下所示,我想删除第一个{没有任何东西只有第一个字符串的开头。字符串在替换之前打印正常但在替换其空字符串之后。
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";