On Wed, 2 Oct 2002, Stephen Clouse wrote:
 
> Hmmm...may I make a plea otherwise :)  Being able to pass a reference is much
> preferred when outputting large strings (as we tend to do).  I suppose I'd have
> to hear why it was considered a mistake, since I really don't see it as anything
> but useful.

because the arguments passed to the print xsub are not copied.

unlike a perl sub:

sub print {
    my(@args) = @_;
}

where @_ is copied into @args.

so there's no advantage for the xsub to accept a scalar ref.

suggestion is to keep refs in perl land, but dereference before passing to 
xsub land, like so:

my $html = <<EOF;
...
EOF
output($r, \$html);

sub output {
    my($r, $data) = @_;
    $r->print($$data);
}


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to