|
|
| Pathologically Eclectic Rubbish Lister | |
| PerlMonks |
Re: Possible to refer to variable defined later in script?by marto (Chancellor) |
| on Nov 12, 2012 at 15:56 UTC ( #1003471=note: print w/ replies, xml ) | Need Help?? |
|
Wouldn't the simple (and sane) thing be to output the HTML after you have processed your input and given values to variables? Also, you may want to consider using HTML::Template or similar to separate your Perl code from your HTML/CSS/JS. You could also consider making this a dynamic page rather than writing a static HTML file each time the script runs. Though this may be out of scope for this coursework. Update: I don't know if this is your entire code, but I'd suggest adding use strict; use warnings; (see Use strict and warnings or search for more), ensure you're opening files properly by checking for errors, for example:
Such things help prevent facepalm.
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||