Let\'s say I have a text file created using Data::Dumper, along the lines of:
my $x = [ { foo => \'bar\', asdf => undef }, 0, -4, [ [] ] ];
I think you want to put
our $x;
into your code before accessing x. That will satisfy the strict error checking.
That being said, I join the other voices in suggesting Storable.