in reply to Re: Modular Code
in thread Modular Code

I would not set a global variable from a subroutine (This would be very un-OOP like, not that this is OOP anyway). And you don't need to quote the file when opening it:
my @contents = &open_file(myfile.txt); sub open_file { open(FILE, $_[0]) or die "could not open FILE $_[0]: $!"; my @contents = <FILE>; close(FILE); @contents; }