I've started writing a RubyUnit test suite for the built-in Ruby
classes, and I've come across something I don't understand in
array.pack.


Given a file 'hello' containing:

    hello
    hello

and the following program:

    puts "begin 644 file"
    while gets
      print [$_].pack("u")
    end
    puts "end"

I get

    begin 644 file
    &:&5L;&\*
    &:&5L;&\*
    end

Pipe this into uudecode and I get "uudecode: stdin: Short file"

If you use uuencode on the file 'hello', the encoded string looks
different:

    % cat hello | uuencode file
    begin 644 file
    ,:&5L;&\*:&5L;&\*
    `
    end

Am I using pack incorrectly, or has the test suite found a bug ;-)


Dave