Description: | 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! |
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) ; }