hi guys
i am trying to read a  file <FILEHANDLE>
before this i use the foll code
if (-B $filepath) {binmode FILEHANDLE;}

while (<FILEHANDLE>)
{
  rest of stuff;
}
this code works fine for all files EXCEPT  PDF files where it fails to 
detect the PDF file as binary file and hence binmode (FILEHANDLE) is not 
executed


#########################################
#   read from the file into a stream
#    $stream = readf($filepath)
#########################################
    sub readf {
    my ($path) = @_;
    
    open (FILEHANDLE,"$path") ;
    if (-B $path) { binmode (FILEHANDLE);}

    $stream="";

    while ($line = <FILEHANDLE>)
    {
        $stream=  $stream.$line;
    }

             close FILEHANDLE;
     return $stream;
   }


$path = 'd:\test\a.pdf';
$stream = readf($path);
$l = length($stream);


can anyone help me out??

awaiting replies from all u JAPH s
khizar


---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
         [EMAIL PROTECTED]
For non-automated Mailing List support, send email to  
         [EMAIL PROTECTED]

Reply via email to