--=-M3ARuu4mBmyahaZUfWG5
Content-Type: multipart/alternative; boundary="=-0yx/9FOCCP88FVbBYwnC"


--=-0yx/9FOCCP88FVbBYwnC
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

File: test1.rb:

        require 'test2'
        puts "test1.rb =3D " + DATA.readlines.to_s
        __END__
        This is the data in test1.rb.


File: test2.rb:

        puts "test2.rb =3D " + DATA.readlines.to_s
        __END__
        This is the data in test2.rb.


Command session:

        $ ruby test1.rb
        test2.rb =3D This is the data in test1.rb.
        test1.rb =3D=20
        $=20


To say this is unexpected is putting it mildly.  What I'd expect to see
is:

        $ ruby test1.rb
        test2.rb =3D This is the data in test1.rb.
        test1.rb =3D=20
        $=20


So two questions:

      * Why is test2 getting the data from test1 and not from itself?
      * How can get the behaviour I'm looking for?


--=20
Michael T. Richter <ttmrichter / gmail.com> (GoogleTalk:
ttmrichter / gmail.com)
All really first class designers are both artists, engineers, and men of
a powerful and intolerant temper, quick to resist the least modification
of the plans, energetic in fighting the least infringement upon what
they regard as their own sphere of action. (Nevil Shute)

--=-0yx/9FOCCP88FVbBYwnC
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; CHARSET=3DUTF-8">
  <META NAME=3D"GENERATOR" CONTENT=3D"GtkHTML/3.12.1">
</HEAD>
<BODY>
File: test1.rb:<BR>
<BLOCKQUOTE>
    <TT>require 'test2'</TT><BR>
    <TT>puts &quot;test1.rb =3D &quot; + DATA.readlines.to_s</TT><BR>
    <TT>__END__</TT><BR>
    <TT>This is the data in test1.rb.</TT><BR>
</BLOCKQUOTE>
<BR>
File: test2.rb:<BR>
<BLOCKQUOTE>
    <TT>puts &quot;test2.rb =3D &quot; + DATA.readlines.to_s</TT><BR>
    <TT>__END__</TT><BR>
    <TT>This is the data in test2.rb.</TT><BR>
</BLOCKQUOTE>
<BR>
Command session:<BR>
<BLOCKQUOTE>
    <TT>$ </TT><TT><B>ruby test1.rb</B></TT><BR>
    <TT><I>test2.rb =3D This is the data in test1.rb.</I></TT><BR>
    <TT><I>test1.rb =3D </I></TT><BR>
    <TT>$ </TT><BR>
</BLOCKQUOTE>
<BR>
To say this is unexpected is putting it mildly.&nbsp; What I'd expect to se=
e is:<BR>
<BLOCKQUOTE>
    <TT>$ </TT><TT><B>ruby test1.rb</B></TT><BR>
    <TT><I>test2.rb =3D This is the data in test1.rb.</I></TT><BR>
    <TT><I>test1.rb =3D </I></TT><BR>
    <TT>$ </TT><BR>
</BLOCKQUOTE>
<BR>
So two questions:
<UL>
    <LI>Why is test2 getting the data from test1 and not from itself?
    <LI>How can get the behaviour I'm looking for?
</UL>
<BR>
<TABLE CELLSPACING=3D"0" CELLPADDING=3D"0" WIDTH=3D"100%">
<TR>
<TD>
-- <BR>
<B>Michael T. Richter</B> &lt;<A HREF=3D"mailto:ttmrichter / gmail.com">ttmri=
chter / gmail.com</A>&gt; (<B>GoogleTalk:</B> ttmrichter / gmail.com)<BR>
<I>All really first class designers are both artists, engineers, and men of=
 a powerful and intolerant temper, quick to resist the least modification o=
f the plans, energetic in fighting the least infringement upon what they re=
gard as their own sphere of action. (Nevil Shute)</I>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>

--=-0yx/9FOCCP88FVbBYwnC--

--=-M3ARuu4mBmyahaZUfWG5
Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)

iD8DBQBG1/wOLqyWkKVQ54QRAqgNAKCDZTU8EFM4FN0I/JS0sDsm3K7kmwCfV6Sk
zzFKWlB/XRx3pL9qKFW6hlI=
=SgIE
-----END PGP SIGNATURE-----

--=-M3ARuu4mBmyahaZUfWG5--