1 # Dobrica Pavlinusic, <dpavlin@rot13.org> 06/22/07 14:35:38 CEST
8 use base qw/Class::Accessor/;
9 __PACKAGE__->mk_accessors( qw/
14 use Data::Dump qw/dump/;
18 CWMP::Tree - description
24 my $obj = CWMP::Tree->new({
32 my $self = $class->SUPER::new( @_ );
34 warn "created ", __PACKAGE__, "(", dump( @_ ), ") object\n" if $self->debug;
41 Perl is dynamic language and we want parametars from TR-069 as
42 a tree. So we do rewrite of parametar to perl code and eval that.
44 my $perl = $self->name2perl( 'InternetGatewayDevice.DeviceSummary' );
49 my ( $self, $s ) = @_;
51 confess "no name?" unless $s;
53 warn "===> $s\n" if $self->debug;
54 $s =~ s/^([^\.]+)/{'$1'}/;
55 warn "---> $s\n" if $self->debug;
58 while ( $s =~ s/\.(\d+)/->[$1]/ ) {
60 warn "-\@-> $s\n" if $self->debug;
62 while ( $s =~ s/\.([a-zA-Z0-9_]+)/->{'$1'}/ ) {
64 warn "-\$-> $s\n" if $self->debug;
68 warn "## $s ", dump( $stat ), $/ if $self->debug;