> Question: what am I doing wrong?

What is the error message you recieve, and what is the content of the 
array? It *should* work (your .slice cuts away the first some members of 
the array) but its a bit hard to see whats going on (i dont have dpkg 
here to test)

Btw "class dpkg" is unusual in that the first char is lowercased. 
Typical ruby code will normally be like so "class Dpkg" (just look at 
Array.new which is "class Array" or String.new which is "class String")

By the way I also recommend you to do this during debugging:
require 'pp'


And at your stdin, stderr line try a
pp stdin
pp stderr
pp @InstalledPackageList

yes is a primitive way to "debug" but very quick and pp makes it look 
pretty :)
(and if some code block fails, you can always but begin;rescue;end 
around it or even catch the error with a

begin
  your critical code here
rescue Exception => e
  pp "error was "
  pp e
end
-- 
Posted via http://www.ruby-forum.com/.