my $file = "somefile.txt"; print "Opening and displaying $file:\n"; include($file); print "Complete\n"; exit; sub include { my $include = $_[0]; open(INFILE,"<$include") || die "Can't find or open $include\n"; @FileContent = ; close(INFILE); foreach $line (@FileContent) { print $line; } }