Calling $Response->Write from perl

Discussion in 'Programming/Scripts' started by savimonty, Apr 7, 2006.

  1. savimonty

    savimonty New Member

    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: :)
     
    Last edited: Apr 7, 2006
  2. sbovisjb1

    sbovisjb1 New Member HowtoForge Supporter ISPConfig Developer

  3. sbovisjb1

    sbovisjb1 New Member HowtoForge Supporter ISPConfig Developer

  4. savimonty

    savimonty New Member

    did not help ...

    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
     
    Last edited: Apr 7, 2006
  5. falko

    falko Super Moderator Howtoforge Staff Moderator HowtoForge Supporter ISPConfig Developer

    Do you find any errors in the logs?
     
  6. savimonty

    savimonty New Member

    The error I see ...

    $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.
     
    Last edited: Apr 7, 2006

Share This Page