Paul <[EMAIL PROTECTED]> writes:
> BTW, this is another use of the same sort of trick as 
> 
>   { local $/ = undef;
>     $file = <FH>; # slurp the whole file into $file
>   }
> 
> which is more efficient than
> 
>    while(<FH>) { $file .= $_ }
> 
> or 
> 
>    $file = join '', <FH>;
> 
> Still, I have a coworker who swears by the latter as more work, yes,
> but MUCH more readable in his opinion.....

You know, I think I agree with your cow orker. The intent of the last
version is obvious. It'd be interesting to see profiling data from a
typical app that slurped in a whole file to see if the method of
slurping made a significant difference in the running time.

-- 
Piers Cawley
www.iterative-software.com

Reply via email to