CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
creating cgi scripts with a cgi script - \ and other characters

 



kind1
Deleted

May 1, 2000, 8:28 PM

Post #1 of 3 (519 views)
creating cgi scripts with a cgi script - \ and other characters Can't Post

ok..... I have a cgi cript that is creating another cgi script with the OUTFILE command. I know I need to put a '\' in front of $ and @ to make sure they make it to this new cgi program, however, how do I get '\n' to output to a file? it is just making newlines instead... I tried '\\n' but that didn't work... I need it so it can output to html pages (Content-type: text/html\n\n)

thanks for the help


japhy
Enthusiast

May 2, 2000, 10:44 PM

Post #2 of 3 (519 views)
Re: creating cgi scripts with a cgi script - \ and other characters [In reply to] Can't Post

\\n does work.

<BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR>


print qq(print "Content-type: text/html\\n\\n"; );
# or use single quotes
print 'print "Content-type: text/html\n\n";';
# or use a here-doc
print << 'RAW PERL CODE';
print "Content-type: text/html\n\n";
RAW PERL CODE
</pre><HR></BLOCKQUOTE>

[This message has been edited by japhy (edited 05-03-2000).]


perlkid
stranger

May 3, 2000, 9:54 AM

Post #3 of 3 (519 views)
Re: creating cgi scripts with a cgi script - \ and other characters [In reply to] Can't Post

 
I'm not positive but try this,

$content-type = qq~Content-type: text/html\n\n~;

and while the outfile pipe to the program is open

print outfile "$content-type";

I'm not positive about this but you might as well give it a try.

Good Luck!

perlkid

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives