From: ridcully Date: 2007-11-17T23:10:11+09:00 Subject: Weird behavior with hpricot and variable assignment Hi, Could someone please help me to understand the difference of: html = Hpricot( "
" ) (html/'/div').each do |item| x = (item/'/div')[0].to_html p x end output: "
" and html = Hpricot( "
" ) (html/'/div').each do |item| p (item/'/div')[0].to_html end gives "undefined method `[]' for nil:NilClass (NoMethodError)" in line 3 Shouldn't the code snippets semantically be the same? Thanks, Andreas