Welcome Guest ( Log In | Register)



 
Reply to this topicStart new topic
> Xmlhttprequest And Perl
kvarnerexpress
post 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
Go to the top of the page
 
+Quote Post
slu
post 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.
Go to the top of the page
 
+Quote Post
dul
post 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
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic

Collapse

> Similar Topics

Topics Topics
  1. Perl Help(1)
  2. First Perl Programm(5)
  3. Second Perl Programm(0)
  4. Perl Programms(0)
  5. Perl Programming(0)
  6. Using Mysql With Perl(1)
  7. Perl V.s. Php(5)
  8. Easy Authenication With Cgi/perl(0)
  9. Perl Progamming/scripting(3)
  10. Perl/cgi Help!(3)
  11. Perl Interview Questions(1)
  12. Compiling Perl / Python?(3)
  13. Matching Accents In Perl Regular Expresions(1)
  14. Call C Code From Perl(1)
  15. Few Perl Snippets For Misc Things(2)
  1. What Is Perl ? For A Layman Like Me !(7)
  2. Where Do I Install Perl Scripts?(6)
  3. Perl As A Way To Program Desktop Applications(8)
  4. Perl Interactive Mode(2)


 



- Lo-Fi Version Time is now: 24th July 2008 - 02:17 PM