tie my @array, 'Tie::File', "$the_dir$filename", recsep=>']' or die "can't tie file:$!"; print join ']',@array;