It is a binary file, so you need to set the file handle to binary mode.  What
is happening it that it is probably finding an EOF character in the file, and
stopping part way through.

Do this to fix it...

open(FILE, "hans.swf") || die "Konnte die Datei nicht öffnen: ";
binmode FILE;

Rob

----- Original Message -----
From: Jan Harders <[EMAIL PROTECTED]>
Subject: MIME::Base64


> HI,
> I was trying to write a script that encodes a file with Base64 using
> MIME::Base64. Unfortunatley, it doesn't work. Here's my try:
>
> -------cut here-------
> use MIME::Base64;
> open(FILE, "hans.swf") || die "Konnte die Datei nicht öffnen: ";
> open(FILE2, ">hans.b64") || die "Konnte die Datei nicht öffnen: ";
> while(<FILE>)
> {
> $string = encode_base64($_);
> print FILE2 "$string";
> }
> close(FILE);
> close(FILE2);
> -------cut here-------
>
> The Problem is that it doesn't encode the file completely, Just a little
> part of it. Does anybody know what the problem is?
> I attached the file hans.swf, the file I try to encode. It's a simple
> Shockwave-movie made with Flash.
> TIA



---
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