U:RDoc::AnyMethod[iI"trace_var:ETI"Kernel#trace_var;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"HControls tracing of assignments to global variables. The parameter ;FI"D+symbol+ identifies the variable (as either a string name or a ;FI";symbol identifier). _cmd_ (which may be a string or a ;FI"?+Proc+ object) or block is executed whenever the variable ;FI":is assigned. The block or +Proc+ object receives the ;FI"3variable's new value as a parameter. Also see ;FI"&Kernel::untrace_var
.;Fo:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"8trace_var :$_, proc {|v| puts "$_ is now '#{v}'" }
;TI"$_ = "hello"
;TI"$_ = ' there'
;T:@format0o;
; [I"produces:;F@o;; [I"$_ is now 'hello'
;TI"$_ is now ' there';T;
0:
@fileI"eval.c;T:0@omit_headings_from_table_of_contents_below0I"[trace_var(symbol, cmd ) -> nil
trace_var(symbol) {|val| block } -> nil
;F0[ I"(p1, p2 = v2);T@!FI"Kernel;TcRDoc::NormalModule00