On Mon, 19 Jun 2000, John Hughes wrote:
> (Hint - Perl passes all values by reference.
Are you sure thats the case with XS code? I don't personally know XS very
well, but there are some wierd things about it, and this might be one of
them. I know for certain that XML::Parser has a lot of slow-do
> De : Matt Sergeant [mailto:[EMAIL PROTECTED]]>
> On Mon, 19 Jun 2000, John Hughes wrote:
> > (Hint - Perl passes all values by reference.
>
> Are you sure thats the case with XS code?
Yes.
--
John Hughes <[EMAIL PROTECTED]>,
CalvaEDI SA.Tel: +33-1-4313-3
On Mon, 19 Jun 2000, you wrote:
> > De : Matt Sergeant [mailto:[EMAIL PROTECTED]]>
> > On Mon, 19 Jun 2000, John Hughes wrote:
> > > (Hint - Perl passes all values by reference.
> >
> > Are you sure thats the case with XS code?
>
> Yes.
To expand on John's answer... :), and delve into where th
De : Shane Nay [mailto:[EMAIL PROTECTED]]
> To comment on what John originally said..., arg, here we go. The
> difference between print \$somevariable, and print $somevariable can
> be very significant.
Nope. Not "very".
> Everything is passed internally as a "reference", but that
> doesn't me
>
> I'm sorry, but I think you are simply wrong here. If I call a perl
> function or an XS routine with a variable as an argument it is passed by
> reference. There is *no* copy.
>
> A simple proof:
>
> sub hack {
> $_[0] = 'a new string';
> }
>
> $a = 'an old
While you're "on the line" as it were John, I have a question:
In XS you can pop more than the number of args that were passed into the
function, but "Bad Things will happen". But in perl, it's as if an actual
array were passed into the function. Now everyone talks about subroutine
"overhead" a
On Mon, 19 Jun 2000, John Hughes wrote:
> > Incidentally, the $r->print() method conveniently lets you pass the string
> > you want to send by reference.
>
> Why is that "convenient":
It's convenient for me because I have a scalar ref that I want to
print. Maybe dereferencing it and passing by