82c67f3a174c6bcd5b48f1213e822a5414b2b2a9
[videosite.git] / videosite / JSJSONArrayParser.pm
1 #
2 # A helper class for parsing textual JS hashes into perl 
3 # hashes
4 #
5 # This parser is based on the perl JSON module
6 #
7
8 package videosite::JSJSONArrayParser;
9
10 use videosite::JSArrayParser;
11 use JSON -support_by_pp;
12 @ISA = qw(videosite::JSArrayParser);
13
14 use strict;
15
16 sub new {
17     my $class = shift;
18     my $self = $class->SUPER::new();
19
20     return bless($self, $class);
21 }
22
23 sub parse {
24     my $self = shift;
25     my $s = shift;
26     my $j = JSON->new();
27
28     return $j->loose->allow_barekey()->allow_singlequote()->decode($s);
29 }
30
31 1;