
April 5th, 2006, 12:59 PM
|
|
Junior Member
|
|
Join Date: Apr 2006
Posts: 2
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
PERL: Here Documents
I am teachering PERL for the first time to my High School students... Early in the book I am using to teach (PERL in easy steps) we learned about using HERE documents.
I like this idea, and in conjunction with the editor we're using (dz Soft Perl Editor), it seems like a good way to get around a lot of syntax errors that will come up (quotes, semi-colons, \n, etc.)
Now, I am teaching about parsing and key/values (using the text CGI/PERL by Diane Zak)...
while trying to get this code to run:
print "The capital of ", param('state'), " is ", param('cap'), ".\n";
I removed the following part of the code because I had set up a print <<DOC at the top of the page:
print " and the \n";
as well as all other internal double quotes...
But when I run the code, I get:
The capital of param('state') is param('cap').
I tested a variable ($test=1) and this ran perfectly (displaying a "1"). But for some reason the param statements appear?
HELP!
|