in reply to Re^2: How to read https json?
in thread How to read https json?
I would recommend that you change
into$content =~ s/\/\///; ## had to remove // in front
... where I used the s{}{} notation to avoid leaning matchstick syndrome (thus avoid escaping the / as \/, ie, leaning matchsticks: see perldoc perlop Quote and Quote-like Operators). I also added the \A beginning-of-string anchor (see perlre, search for "Assertions"), because your regexp would have deleted the first //, whether it's at the beginning, or embedded in important data in your json. If there might be spaces before the //, then$content =~ s{\A//}{}; ## remove // at the beginning of the json cont +ent
$content =~ s{\A\s*//}{}; ## remove // at the beginning of the json c +ontent
|
|---|