On 8/17/06, Joey <rubytalk / eachmapinject.com> wrote:
> This:
> File.open(__FILE__, "rb") do |data|
>  # skip to the end
>  line = data.gets until line =~ /^__END__$/
>  f = Marshal.load(data)
>  eval(Zlib::Inflate.inflate(f[:init]))
>  Kernel.zlib_requires = f
>  eval(Zlib::Inflate.inflate(f[:main]))
> end
> __END__
>
> Can be changed to:
> f = Marshal.load(DATA.read)
>  eval(Zlib::Inflate.inflate(f[:init]))
>  Kernel.zlib_requires = f
>  eval(Zlib::Inflate.inflate(f[:main]))
> end
> __END__
>

Thanks, I had tried that -- plus a DATA.binmode (without which it did
not work on Windows at all), but I still had a few issues, it failed
in odd ways -- I did not spend a lot of time tracking it down as I
knew that reopening the file would work -- I will check it again and
see if I can make it work or give more information on the failure.

pth