From: Austin Ziegler Date: 2005-08-13T00:48:11+09:00 Subject: Re: Re-reading a portion of a source file from a specific point On 8/12/05, daz wrote: > Austin Ziegler wrote: > > On 8/12/05, daz wrote: > > > Daniel Berger wrote: > > > > From within a Ruby program, is there a way to get Ruby to re-read itself > > > > from a specific part of the file? > > This only works for the top-level script ($0). It does not work for > > included scripts, the way that Perl's __END__ and DATA markers do. > You just requoted Dan's original question: > "re-read itself" So I did. I meant to quote what you said about using __END__ and DATA. To elaborate for those who may not have understood what I was saying, though:. Consider that Dan's program is "reread.rb". If I do this in "myreread.rb": require 'reread' Then Dan's program will reread from the beginning of "myreread.rb" ($0) and not "reread.rb" if it uses __END__ and DATA. -austin -- Austin Ziegler * halostatue@gmail.com * Alternate: austin@halostatue.ca