|
|
|
|
![]() ![]() |
Aug 27 2005, 10:32 PM
Post
#1
|
|
|
Super Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 407 Joined: 13-December 04 Member No.: 2,696 |
Hi all
I've been using XMLHttpRequest with PHP but the time has come where i need the features of perl! But i've fallen at the first hurdle.... when using XMLHttpRequest with php you can send a response back by using "echo" I cant seem to find a way of sending a response back in perl, anyone know of something similar to echo? I've looked through LWP but couldnt find anything suitable?? thanks kvarnerexpress |
|
|
|
Oct 27 2005, 06:29 PM
Post
#2
|
|
|
Newbie [Level 2] ![]() ![]() Group: Members Posts: 27 Joined: 22-June 05 Member No.: 8,557 |
QUOTE(kvarnerexpress @ Aug 28 2005, 12:32 AM) I cant seem to find a way of sending a response back in perl, anyone know of something similar to echo? I've looked through LWP but couldnt find anything suitable?? That would be print. Here's the most simple perl/cgi-script: CODE #!/usr/local/bin/perl print "Content-Type: text/plain\n\n"; print "hello"; Notes: * You might need to change the path in the first (shebang) line, it depends on your platform... * Change text/plain to text/html if you want to return HTML * print is standard perl and has nothing to do with CGI/LWP - everything sent to standard out is send to the users browser. |
|
|
|
Oct 27 2005, 11:30 PM
Post
#3
|
|
|
Member [Level 1] ![]() ![]() ![]() ![]() Group: Members Posts: 73 Joined: 21-September 05 Member No.: 12,113 |
#!/usr/local/bin/perl
echo "Content-Type: text/plain\n\n"; echo "It is simple"; Try this |
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 25th July 2008 - 10:36 AM |