Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Ruby
Help with IO Code
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Ged Byrne, post: 4413802"] I'm working through "Programming Ruby - The Pragmatic Programmer's Guide" and all has been joy and pleasure. Now, however, I'm in difficulty. From the IO chapter I'm running the following example: require 'net/http' h = Net::HTTP.new('[URL="http://www.pragmaticprogrammer.com"]www.pragmaticprogrammer.com[/URL]', 80) resp, data = h.get('/index.html', nil) puts resp.message #I added this puts data #And this if resp.message == "OK" #Spam assasin didn't like the Img tag in the re. data.scan(/###/) { |x| puts x } end The result I'm getting is: OK nil listimgs.rb:8: private method `scan' called for nil (NoMethodError) The code should list the images on the pragprog home page. Any idea whats going wrong, or how I can find out more about whats going wrong. I'm using 1.8.0-9 ________________________________________________________________________ Want to chat instantly with your online friends? Get the FREE Yahoo! Messenger [URL]http://uk.messenger.yahoo.com/[/URL] [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Ruby
Help with IO Code
Top