# # A helper class for parsing textual JS hashes into perl # hashes # # This parser is based on the perl JSON module # package videosite::JSJSONArrayParser; use videosite::JSArrayParser; use JSON -support_by_pp; @ISA = qw(videosite::JSArrayParser); use strict; sub new { my $class = shift; my $self = $class->SUPER::new(); return bless($self, $class); } sub parse { my $self = shift; my $s = shift; my $j = JSON->new(); my $content; ($content, undef) = $j->loose->allow_barekey()->allow_singlequote()->decode_prefix($s); return $content; } 1;