You are viewing a plain text version of this content. The canonical link for it is here.
Posted to asp@perl.apache.org by Reggie Dindiyal <Rd...@msdinc.com> on 2003/11/24 19:30:59 UTC
RE: Converting ASP/VBScript COM reference to Apache::ASP Perl COM
ref erence
Ok, I followed the suggestions posted and changed the script to this:
-: use strict;;;use vars qw($Application $Session $Response $Server
$Request);;
-: #line 1 d:/websites/default.asp
1: ;;
2: use Win32::OLE;
3: use strict;
4:
5: my $proc = Win32::OLE->new('Project.clsInitialClass');
6: $proc->{Application} = $Application;
7: $proc->{Request} = $Request;
8: $proc->{Response} = $Response;
9: $proc->{Server} = $Server;
10: $proc->{Session} = $Session;
11: $proc->{LoadPage}("D:\RootConfig\config.inc");
Ok, my syntax errors have been fixed for the most part. Now the error seems
to be occuring at the last line, line 11. Here's the error:
Errors Output
Can't use string ("") as a subroutine ref while "strict refs" in use at
d:/websites/default.asp line 11. , D:/Perl/site/lib/Apache/ASP.pm line 1514
Loadpage is a function in my class 'clsInitialClass'. I'm trying to pass
the string "D:\RootConfig\config.inc" to it. How should I accomplish this?
By the way, please pardon my ignorance in Perl. I'm starting to learn the
syntax of it. Thanks to Thanos, Csongor, and Helmut for your help in my
silly syntax errors. :)
Re: Converting ASP/VBScript COM reference to Apache::ASP Perl COM
ref erence
Posted by Thanos Chatziathanassiou <tc...@arx.gr>.
Fagyal, Csongor wrote:
> Reggie,
>
> Without knowing perl syntax and basically perl, IMHO you will have a
> hard time.
>
>> -: use strict;;;use vars qw($Application $Session $Response $Server
>> $Request);;
>>
> Actually I don't think you need to "use vars" here (it probably won't
> hurt, though).
> [...]
I think Apache::ASP has added those. It is the debugging output Reggie
sent us here.
>
>> 11: $proc->{LoadPage}("D:\RootConfig\config.inc");
>>
> This line is not good. This should be:
> $proc->LoadPage("D:\RootConfig\config.inc");
> ...provided that $proc has a LoadPage method.
>
> However, this is only syntax, and not semantics. You will have more
> problems with the later than the former I'm afraid.
Speaking of syntax, even if there is a LoadPage method in the object, it
won't work like this. It must be either
$proc->LoadPage("D:\\RootConfig\\config.inc"); #note the double ``\\''
or
$proc->LoadPage("D:/RootConfig/config.inc"); #use ``/'' instead of ``\''
because ``\'' is the escape char. Which one you choose is a matter of
personal preference.
I recommend browsing through the perlFAQs just to get the hang of it
(``perldoc perlfaq1'' to perlfaq9).
Regards,
Thanos Chatziathanassiou
---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org
Re: Converting ASP/VBScript COM reference to Apache::ASP Perl COM
ref erence
Posted by "Fagyal, Csongor" <co...@conceptonline.hu>.
Reggie,
Without knowing perl syntax and basically perl, IMHO you will have a
hard time.
> -: use strict;;;use vars qw($Application $Session $Response $Server
> $Request);;
>
Actually I don't think you need to "use vars" here (it probably won't
hurt, though).
[...]
> 11: $proc->{LoadPage}("D:\RootConfig\config.inc");
>
This line is not good. This should be:
$proc->LoadPage("D:\RootConfig\config.inc");
...provided that $proc has a LoadPage method.
However, this is only syntax, and not semantics. You will have more
problems with the later than the former I'm afraid.
- Csongor
---------------------------------------------------------------------
To unsubscribe, e-mail: asp-unsubscribe@perl.apache.org
For additional commands, e-mail: asp-help@perl.apache.org