How do I read back in the output of Data::Dumper?

前端 未结 9 1583
暖寄归人
暖寄归人 2021-02-10 02:14

Let\'s say I have a text file created using Data::Dumper, along the lines of:

my $x = [ { foo => \'bar\', asdf => undef }, 0, -4, [ [] ] ];
9条回答
  •  暗喜
    暗喜 (楼主)
    2021-02-10 02:40

    Are you sure that file was created by Data::Dumper? There shouldn't be a my in there.

    Some other options are Storable, YAML, or DBM::Deep. I go through some examples in the "Persistence" chapter of Mastering Perl.

    Good luck, :)

提交回复
热议问题