Let\'s say I have a text file created using Data::Dumper, along the lines of:
my $x = [ { foo => \'bar\', asdf => undef }, 0, -4, [ [] ] ];
This snippet is short and worked for me (I was reading in an array). It takes the filename from the first script argument.
# Load in the Dumper'ed library data structure and eval it my $dsname = $ARGV[0]; my @lib = do "$dsname";