Jump to content
xisto Community
Sign in to follow this  
kvarnerexpress

Xmlhttprequest And Perl

Recommended Posts

Hi allI'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??thankskvarnerexpress

Share this post


Link to post
Share on other sites

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??

179108[/snapback]


That would be print. Here's the most simple perl/cgi-script:

#!/usr/local/bin/perlprint "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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.