>>>>> "D" == Daniel Berger <djberg96 / hotmail.com> writes:

D> fork{
D>    m.gsub!(/fox/,"badger")
D> }

 Like said it has internal state, try this

svg% cat test.txt
The quick brown fox jumped over the lazy dog's back
three times, one per line.
svg% 

svg% cat b.rb
#!/usr/bin/ruby
file = "test.txt"

m = File.new(file,"a")

pid = fork

fork{
   m.puts "aaa"
}

Process.wait
m.puts "bbb"

svg% 

svg% b.rb
svg%
 
svg% cat test.txt
The quick brown fox jumped over the lazy dog's back
three times, one per line.
aaa
aaa
bbb
bbb
svg% 


Guy Decoux