in reply to Calling a Variable from another file
You can also play with the Data::Dumper syntax so that the string had "$data =" instead of "$VAR1 =".# storing: my $data = ... ; # some big hairy data structure open FILE, ">$filename" or die "can't open '$filename': $!"; print FILE Dumper($data); close FILE; # retrieving: open FILE, "$filename" or die "can't open '$filename': $!"; my $VAR1; eval do{ local $/=undef; <FILE> }; # your big hairy data structure is in $VAR1 now close FILE;
|
|---|