Changeset 25411

Show
Ignore:
Timestamp:
18.04.2012 10:39:00 (8 years ago)
Author:
jmt12
Message:

Adding in test when storing output handle to prevent binmode() function being called on output handles that aren't GLOBs (such as the objects returned by GDBMServer and TDBServer)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/basebuildproc.pm

    r24754 r25411  
    195195 
    196196    $self->{'output_handle'} = $handle; 
     197    # The output handle isn't always an actual handle. In a couple of the 
     198    # database drivers (MSSQL and GDBMServer) it's actually a reference 
     199    # to an object. Thus we need to test the type before setting binmode. 
     200    # [jmt12] 
     201    if (ref $handle eq "GLOB") 
     202    { 
     203      binmode($handle,":utf8"); 
     204    } 
    197205    binmode($handle,":utf8"); 
    198206}