in reply to perl Segmentation fault (with Storable?)

Any segmentation fault is a bug (it may be a known bug; see rt://Storable). I haven't run your code, but I notice that $ENV{PWD} on my system does not have a trailing slash. As such, $ENV{PWD}."test" may not be what you want. You may want $ENV{PWD}."/test" or you may want to have a look at File::Spec (specifically, catfile).

Replies are listed 'Best First'.
Re^2: perl Segmentation fault (with Storable?)
by eserte (Deacon) on Nov 20, 2007 at 21:18 UTC
    Any segmentation fault is a bug
    Not always. It is possible to get segmentation faults by exceeding the maximum memory in perl.

    In theory this could also happen with a bad Storable file, i.e. if some wrong length parameter causes memory overflow.

    Addendum: while this is true for retrieve, a segfault should never happen with store, as in the code of the poster.

Re^2: perl Segmentation fault (with Storable?)
by glide (Pilgrim) on Nov 20, 2007 at 17:28 UTC
    In the real program .. I'm not using the $ENV{PWD} (I'm using the FindBin). But in the example I used the %ENV just to remove dependencies.
      Seeing the real (minimal) program that causes the problem might enable someone to spot the cause of the problem.