glide has asked for the wisdom of the Perl Monks concerning the following question:
i have tested the script with perl versions: v5.8.5, v5.8.7, v5.8.8 in a ubuntu and fedora linux. (but if i remove the "skip" subroutine, the program run without any problem.)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; }
Any ideas?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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: perl Segmentation fault (with Storable?)
by shmem (Chancellor) on Nov 20, 2007 at 21:57 UTC | |
by grinder (Bishop) on Nov 21, 2007 at 07:36 UTC | |
by shmem (Chancellor) on Nov 21, 2007 at 09:18 UTC | |
|
Re: perl Segmentation fault (with Storable?)
by kyle (Abbot) on Nov 20, 2007 at 17:16 UTC | |
by eserte (Deacon) on Nov 20, 2007 at 21:18 UTC | |
by glide (Pilgrim) on Nov 20, 2007 at 17:28 UTC | |
by apl (Monsignor) on Nov 20, 2007 at 20:17 UTC | |
|
Re: perl Segmentation fault (with Storable?)
by Anonymous Monk on Nov 20, 2007 at 20:03 UTC | |
by glide (Pilgrim) on Nov 21, 2007 at 10:55 UTC | |
|
Re: perl Segmentation fault (with Storable?)
by Anonymous Monk on Dec 23, 2007 at 19:16 UTC |