> package Foo;
> $Response->Write("Hello World"); # wrong...
>
> I looked in ASP.pm and they did something similiar to
>
> package Foo;
> use vars qw($Response);
> $Response = $main::Response;
> $Response->Write("hello world");
>
> If I don't want to override anything then shouldn't I make $Foo::Response
> and alias to $main::Response and not just a copy of it? Something like
>
> package Foo;
> use vars qw($Response);
> local(*Response) = *main; # ??? this is wrong
> *Response = \$main::Response; # so is this
No need for anything like this in this case.
The $Response is a reference (just like any other Perl object).
So by that
$Response = $main::Response;
you copy the reference and than both $main::Response and $Response
point to the same object.
The difference between a reference copy and alias would only show up
if you undefed $mail::Response during the script execution.
And alias would be undefed as well while a reference copy would still
point to an existing object. And if you then set $main::Response to
something else your $Response would stay the same.
As I said .. no difference here.
Jenda
== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==
: What do people think?
What, do people think? :-)
-- Larry Wall in <[EMAIL PROTECTED]>
_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web