As kevbot said your example is flawed.
This works for me
use strict; use warnings;
use Data::Dumper;
my %hash;
my $loadedFile = join "", <DATA>;
{
no strict;
eval ($loadedFile);
if ($@) {print 'eval error:'.$@."\n"; }
}
my @hashData = $hash{Scope}{model};
my @dereferencedData;
foreach my $line (@hashData){
@dereferencedData = @$line;
}
print "Data: \n";
print Dumper @dereferencedData;
print "\n";
__DATA__
%hash = (
#scope changes
Scope => {
model => [
1,2,3,4,5,6
]
},
IrreleventScope =>{
a=>'b'
}
)
;
Result
Data:
$VAR1 = 1;
$VAR2 = 2;
$VAR3 = 3;
$VAR4 = 4;
$VAR5 = 5;
$VAR6 = 6;
Notice the addition of a semi to the end of your example data