D
Damphyr
Well it's the short calm period before the storm of an upcoming product
release and I 'm stealing time to code something interesting for a change.
And I've picked the time to switch from 1.6.8 to 1.8.0
. Unfortunately
the calm period is much too short to be able to do it on the Linux boxes
(where code of some actual value is running
) so I'm playing about
with the PP package.
And I've stumbled on some wierd behaviour using CGI.
The following code is straightforward and simple:
def taken? name
b=["one","two"]
return "" if (b.include?(name) )
return " not"
end
name="one"
puts "#{name} does #{taken?(name)} exist"
name="three"
puts "#{name} does #{taken?(name)} exist"
will give:
three does not exist.
Now, using a simple form and a mini http server (it's called Xerver -
it's a java thingy that comes in handy) that is cgi capable I duplicate
this functionality in the following:
require 'cgi'
def taken? name
b=["one","two"]
return "" if (b.include?(name) )
return " not"
end
cgi = CGI.new("html3") # add HTML generation methods
cgi.out {
cgi.html { cgi.head { cgi.title{"Availability"} }+
cgi.body { name=cgi.params["name"]
"#{name} does #{taken?(name)} exist"}
}
}
which outputs:
one does not exist
and
three does not exist
Does anybody have any idea why this would happen?
I'll test it on an Apache installation I've got, but I can't see why it
would be any different.
V.-
____________________________________________________________________
http://www.freemail.gr - äùñåÜí õðçñåóßá çëåêôñïíéêïý ôá÷õäñïìåßïõ.
http://www.freemail.gr - free email service for the Greek-speaking.
release and I 'm stealing time to code something interesting for a change.
And I've picked the time to switch from 1.6.8 to 1.8.0
the calm period is much too short to be able to do it on the Linux boxes
(where code of some actual value is running
with the PP package.
And I've stumbled on some wierd behaviour using CGI.
The following code is straightforward and simple:
def taken? name
b=["one","two"]
return "" if (b.include?(name) )
return " not"
end
name="one"
puts "#{name} does #{taken?(name)} exist"
name="three"
puts "#{name} does #{taken?(name)} exist"
will give:
one does existruby simple.rb
three does not exist.
Now, using a simple form and a mini http server (it's called Xerver -
it's a java thingy that comes in handy) that is cgi capable I duplicate
this functionality in the following:
require 'cgi'
def taken? name
b=["one","two"]
return "" if (b.include?(name) )
return " not"
end
cgi = CGI.new("html3") # add HTML generation methods
cgi.out {
cgi.html { cgi.head { cgi.title{"Availability"} }+
cgi.body { name=cgi.params["name"]
"#{name} does #{taken?(name)} exist"}
}
}
which outputs:
one does not exist
and
three does not exist
Does anybody have any idea why this would happen?
I'll test it on an Apache installation I've got, but I can't see why it
would be any different.
V.-
____________________________________________________________________
http://www.freemail.gr - äùñåÜí õðçñåóßá çëåêôñïíéêïý ôá÷õäñïìåßïõ.
http://www.freemail.gr - free email service for the Greek-speaking.