3 # Copyright (c) 1995-2000, Raphael Manfredi
5 # You may redistribute only under the same terms as Perl 5, as specified
6 # in the README file that comes with the distribution.
8 # Original Author: Ulrich Pfeifer
9 # (C) Copyright 1997, Universitat Dortmund, all rights reserved.
14 require Config; import Config;
15 if ($ENV{PERL_CORE} and $Config{'extensions'} !~ /\bStorable\b/) {
16 print "1..0 # Skip: Storable was not built\n";
21 use Storable qw(store retrieve);
24 # problems with 5.00404 when in an BEGIN block, so this is defined here
25 if (!eval { require File::Spec; 1 } || $File::Spec::VERSION < 0.8) {
26 plan(skip_all => "File::Spec 0.8 needed");
27 # Mention $File::Spec::VERSION again, as 5.00503's harness seems to have
29 exit $File::Spec::VERSION;
34 *GLOB = *GLOB; # peacify -w
35 my $bad = ['foo', \*GLOB, 'bar'];
38 eval {$result = store ($bad , 'store')};
42 $Storable::forgive_me=1;
44 my $devnull = File::Spec->devnull;
46 open(SAVEERR, ">&STDERR");
47 open(STDERR, ">$devnull") or
48 ( print SAVEERR "Unable to redirect STDERR: $!\n" and exit(1) );
50 eval {$result = store ($bad , 'store')};
52 open(STDERR, ">&SAVEERR");
57 my $ret = retrieve('store');
61 is(ref $ret->[1], 'SCALAR');
64 END { 1 while unlink 'store' }