perl script_ma.pl
### DESTROY - start
### _write_configuration - store start
Segmentation fault
####
#!/usr/bin/perl
use strict;
use warnings;
use lib "$ENV{PWD}";
use myConfig;
# create the objecto for write the db
my $c_config = myConfig->new();
# add default to the configuration db
$c_config->add_default(default=>'aa');
sub skip {
my (%args)=@_;
$c_config->add_default(default=>'bb');
return 0;
}
####
package myConfig;
use strict;
use warnings;
use Storable qw(store);
use Class::Std::Utils;
use Smart::Comments;
{
my %db_data;
sub new {
my ($class, %args) = @_;
my $new_object = bless anon_scalar( ), $class;
return $new_object;
}
sub _write_configuration {
my ($self,%args) = @_;
### _write_configuration - store start
store( $db_data{ident $self}, $ENV{PWD}."test") or die($!);
### _write_configuration - return
return;
}
sub add_default {
my ($self,%args) = @_;
$db_data{ident $self}{default} = $args{default};
return;
}
sub DESTROY {
my ($self) = @_;
### DESTROY - start
$self->_write_configuration();
### DESTROY - finish
return;
}
}
1;