<?xml version="1.0" encoding="windows-1252"?>
<node id="62398" title="Perl is psychic?!" created="2001-03-05 23:57:03" updated="2005-08-05 18:13:40">
<type id="115">
perlquestion</type>
<author id="56379">
MrNobo1024</author>
<data>
<field name="doctext">
&lt;code&gt;
'foo' =~ m/.*/;
print eval &lt;STDIN&gt;;
&lt;/code&gt;

I ran this program, and entered the text '$&amp;'. It printed out 'foo'. If you don't use $`, $&amp;, or $' in your program at all, they aren't set on a regex match. There was no way for Perl to know I was going to enter $&amp; into STDIN, so why did it set it? Does this mean that Perl is psychic?</field>
</data>
</node>
