At Fri, 23 Aug 2002 03:44:26 +0900,
Jim Freeze wrote:

> How would I modify the text below __END__?
> 
> ----- begin file ---
> # code to modify text below
> __END__
> change me
> ---- end file---

You mean like this?

f = open(__FILE__, "r+")
if /(.*?^__END__$.*?)(^.+)/m =~ f.read
  script_size = $1.size
  f.pos = script_size
  f.truncate(script_size)
  f << $2.gsub(/^/, "> ") + "hello?\n"
end
f.close
__END__
hello?