On Wed, Aug 31, 2005 at 12:00:31PM +1200, Roy Britten wrote:
> We're not going to have a language war, are we?

i hope not :-)
i like comparing what different languages offer to solve problems.

> #!/usr/bin/env ruby
> require 'uri/common.rb'
> puts URI.unescape(ARGV[0])

that does not handle stdin.
you want something like:

STDIN.each { 
  |line|
  puts URI.unescape(line)
}


note that i can't figure out why the {} have to be places like they are.

{} encloses a block of code, i get that, but why is the { required to be
on the same line? 

if i don't put it there, i get a syntax error at the l in line:
./urldecode.ry:6: syntax error
  |line| 
   ^

|line| seems to be a way to pass a value into a block of code. 
seems a strange way to avoid making the block a real lambda with function
arguments.

greetings, martin.
-- 
cooperative communication with sTeam      -     caudium, pike, roxen and unix
offering: programming, training and administration   -  anywhere in the world
--
pike programmer   travelling and working in europe             open-steam.org
unix system-      bahai.or.at                        iaeste.(tuwien.ac|or).at
administrator     (caudium|gotpike).org                          is.schon.org
Martin Bähr       http://www.iaeste.or.at/~mbaehr/

Reply via email to