use Tie::File; use Data::Dumper; my $self = tie @array, "Tie::File", "a.pl"; print Dumper($self); unshift @array, "abcd"; print Dumper($self);