Paul wrote:
> 
> >               if (open SEARCH_FILE, "< $fileName") {
> >                       my $searchData = join "", <SEARCH_FILE>;
> >                       close SEARCH_FILE;
> 
> ok, $searchData should be the whole file, but maybe it's the line-based
> read you're doing. A less attractive but more efficient way is
> 
>   if (open SEARCH_FILE, "< $fileName") {
>     local $_ = undef;
>     $searchData = <SEARCH_FILE>;
>   }
> 
> That slurps it all in as one big scalar read.


perldoc -q "How can I read in an entire file all at once"


if ( open SEARCH, $fileName ) {
    binmode SEARCH;
    $searchData = do { local $/; <SEARCH> };
    }




John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to