PDA

View Full Version : Calling $Response->Write from perl


savimonty
7th April 2006, 07:48
Hi,

I need to know how to call ASP Object calls from a perl script.

for eg:

I tried the following ...

# trial.pl
use Apache::ASP::Response;

$Response = Apache::ASP::Response;
$Response->Write("Hello World");

#This should print Hello World on the console...!!

This is what i precisely want to do ...
I am sure I am making a mistake somewhere ... guide me with this.

Thanks a milliion

Savio. :confused: :)

sbovisjb1
7th April 2006, 07:58
http://forums.devshed.com/perl-programming-6/perl-script-on-apache-7911.html

sbovisjb1
7th April 2006, 08:02
If you are interested in writing Perl in Apache i suggest that you use these tutorials.
http://www.perlscripten.de/modules.php?name=News&file=print&sid=215
http://httpd.apache.org/docs/2.0/howto/cgi.html

savimonty
7th April 2006, 08:05
Hi,

Thanks for the reply ... but this is not the problem I am facing....

I am not trying to run a CGI script!

I am trying to use the Apache::ASP library which is written completely in perl.

So, I want to use this library to run ASP Object calls from another perl script file

For example, consider a perl file : call_Response.pl
######################################
# call_Response.pl
#####################################
# Creating the $Response object

use Apache::ASP::Response; ### i think i am garbling here....

$Response = Apache::ASP::Response; ### here too
$Response->Write("Hello World"); #Prints "Hello World" on the console


## Now this is not just for the $Response Object .... I will need to call other objects also.
## Like the $Server and the $Session object calls.

###################################

Now at the prompt I should get the following

$perl call_Response.pl
Hello World

I hope this fine-tunes the problem.

Thanks.
Savio

falko
7th April 2006, 12:55
Do you find any errors in the logs?

savimonty
7th April 2006, 17:03
$perl call_Response.pl
############ ERROR ###############

Undefined subroutine &Apache::ASP::config called at /usr/share/perl5/Apache/ASP/Response.pm line 467

###################################

.... where Response.pm is a asp-perl package containing the method write() and the other methods.

config() is already referenced explicitly in the file Response.pm

So, I do not understand why this is a problem!

Also when I write an ASP scripted in perl and run it using the command asp-perl trial.asp

It works just fine ...
But if I use a normal perl script (NOT asp-perl) to call these methods... it gives me this error.

If necessary I will attach the Response.pm file here. ...

I feel I am making a minor error in declaring the object, $Response.
If so I need to know the correct syntax.

Well, Hope to get a solution to this....!!
Thanks,
Savio.