I'm using Perl to generate dynamic WML, however, I'm not able to pass variables between different subroutines.

This is part of the code in one of the subroutines:

print <<END_of_wml;
Content-type: text/vnd.wap.wml
<p>Please enter a course code:</p>
<input name="course_code" size="9"/><br/>
<go href="wml.cgi" method="post">
<postfield name="action" value="check_course"/>
<postfield name="abc" value="$course_code"/>

In another subroutine, I tried to display $abc:

print <<END_of_wml;
Content-type: text/vnd.wap.wml
<card id="test" title="check">
abc = $abc

The the content of $abc is blank. I also tried \$abc, but still...

What did I do wrong?