Error:
script.rb:23:in `getCookies': undefined method `split' for ["comeon",
"blah"]:A
rray (NoMethodError)

My method using an optional argument:
def getCookies(*c)
    c[1]="blah"
  $cookiesA = [] if $cookiesA == nil
    $cookiesA = c.split(";") unless c == nil
  $cookiesH = {}
  $cookiesA.each {|e|
    e.match(/(.*)=(.*)/)
    $cookiesH[$1]=$2
    }
  $cookiesA  = $cookiesH.map{|k, v| "#{k}=#{v}"}
  $cookies = $cookiesA.join(";")
  return $cookies
end

I don't know how to fix this. I wanted to make a Cookies class..
So I can't use a lot of methods on optional arguments?

-- 
Posted via http://www.ruby-forum.com/.