http://qs1969.pair.com?node_id=2871

I think that both of these use the minimum amount of code. (doing the job properly - using my and close)
Post if you have a better way!
Return the file contents as a scalar value
sub readfile { my $OP ; open FS, $_[0] ; while (<FS>) {$OP .= $_} close FS ; return $OP ; }


Returns the contents of a file in list form (line by line)
sub readlines { open FS, $_[0] ; my (@OP) = <FS> ; close FS ; return (@OP) ; }