use Storable; my $stored = freeze [ \$data, \@dataset, \%datagroup ]; print $stored; # just to see what it looks like, in binary encoding my $thawed = thaw $stored; my ($newdata, $newdataset_ref, $newdatagroup_ref) = @$thawed; # copies of original variables (*data, *dataset, *datagroup) = @$thawed; # restore into the original variables