In message "[ruby-talk:00578] trace_var doesn't work with $< ???"
on 99/08/06, clemens.hintze / alcatel.de <clemens.hintze / alcatel.de> writes:
|I try do do the following...
|
| p :$<
| p "$<".intern
|
| trace_var :$<, proc { p "New file" }
|
| while gets
| p "#{$.}(#{$<}): #{$_}"
| end
|But I didn't get the lines with the `****' remark! What do I wrong?
Because opening new file, does not assign $<, but just change the
state of $< object. You will know it by following script:
trace_var :$<, proc { p "New file" }
while gets
p "#{$.}(#{$<};#{$<.id}): #{$_}"
end
The $<.id is unchanged.
matz.