package CodeSet; use strict; use warnings; use Tie::File; use Exporter; use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); $VERSION = 1.00; @ISA = qw(Exporter recControlObject); @EXPORT = (); @EXPORT_OK = qw(); %EXPORT_TAGS = ( 'all' => [ qw() ] ); #constructor sub new { my $class = shift; my $self = { }; bless ($self, $class); return $self; } print "outside sub\n"; my $filepath = 'C:/TEMP/test extended code/test1.txt'; my @file; tie @file, 'Tie::File', $filepath; for (@file) { print "$_\n"; } print "line2 = $file[1]\n"; sub Process { my $self = shift; print "inside sub\n"; my $filepath = 'C:/TEMP/test extended code/test1.txt'; my @file; tie @file, 'Tie::File', $filepath; for (@file) { print "$_\n"; } print "line2 = $file[1]\n"; } 1;