On Sat, Aug 30, 2008 at 2:59 PM, Hwang In-seok <his2000x / gmail.com> wrote:
> hi
>
> sorry!
> i can not speak english well..
>
>
> This is how I know...
> "abcdef".gsub(/c/) {|h| puts h}
>
> but, Why do I get an error that my code..
>
> this is my code
>
>
> require 'net/http'
>
>
> page= Net::HTTP.new('www.google.co.kr',80)
>
>
> reg = page.get('/index.html')
>
> reg.gsub(/a/) {|gg| puts gg}
> puts reg
>
> thank you...

String#gsub does string substitution, but it cannot replace /a/ with
nil, and the return value of 'puts' is nil.
Maybe you want to try String#scan instead, like this:

    p reg.scan(/a/)

^ manveru