"Jeffrey W. Baker" <[EMAIL PROTECTED]> writes:
> Apache::print() dereferences its arguments. For example, this code:
>
> my $foo = "bar";
> $r->print(\$foo);
>
> prints "bar" instead of the expected SCALAR(0xDEADBEEF). Can anyone
> explain the purpose of this behavior, or is it a misfeature? In my case,
> this is not the desired behavior.
If I recall correctly, this is a performance issue. If you have a
large string you want to print, sending a reference will result in
less data copying etc. I don't know how much it pays off, but it is
an intended effect.
You could try something like:
$r->print("@{[\$foo]}");
Chip
--
Chip Turner [EMAIL PROTECTED]
ZFx, Inc. www.zfx.com
PGP key available at wwwkeys.us.pgp.net
- Why does $r->print() dereference its arguments? Jeffrey W. Baker
- Re: Why does $r->print() dereference its argume... Stas Bekman
- Re: Why does $r->print() dereference its argume... Chip Turner
- Re: Why does $r->print() dereference its ar... Jeffrey W. Baker
- Re: Why does $r->print() dereference it... Gunther Birznieks
- Re: Why does $r->print() dereference its argume... Randal L. Schwartz
- Re: Why does $r->print() dereference its argume... Doug MacEachern
- Re: Why does $r->print() dereference its ar... Jeffrey W. Baker
- Re: Why does $r->print() dereference it... Doug MacEachern
- RE: Why does $r->print() dereference its argume... Geoffrey Young
- RE: Why does $r->print() dereference its ar... Stas Bekman
- RE: Why does $r->print() dereference its argume... Geoffrey Young
- RE: Why does $r->print() dereference its ar... Stas Bekman
