Thread JSON Regex ausgeben (35 answers)
Opened by bianca at 2013-10-30 08:46

pq
 2013-10-30 08:58
#171643 #171643
User since
2003-08-04
12208 Artikel
Admin1
[Homepage]
user image
steht doch in der doku. JSON kann von haus aus keine objekte:
Quote
convert_blessed

$json = $json->convert_blessed([$enable])

$enabled = $json->get_convert_blessed


If $enable is true (or missing), then encode, upon encountering a blessed object, will check for the availability of the TO_JSON method on the object's class. If found, it will be called in scalar context and the resulting scalar will be encoded instead of the object.


du müsstest eine sub Regexp::TO_JSON schreiben.
sinnvoller erscheint mir aber, gleich eine string-version der regex zu speichern statt des objekts.
Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live. -- Damian Conway in "Perl Best Practices"
lesen: Wiki:Wie frage ich & perlintro Wiki:brian's Leitfaden für jedes Perl-Problem

View full thread JSON Regex ausgeben