my @contents = &open_file(myfile.txt); sub open_file { open(FILE, $_[0]) or die "could not open FILE $_[0]: $!"; my @contents = ; close(FILE); @contents; }