use Tie::File; tie @array, 'Tie::File', "filename" or die "something is wrong: $! \n";