Re: $r->print and references: Was RE: Slightly OT - Content-length

2000-06-19 Thread Matt Sergeant
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

RE: $r->print and references: Was RE: Slightly OT - Content-length

2000-06-19 Thread John Hughes
> 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

RE: $r->print and references: Was RE: Slightly OT - Content-length

2000-06-19 Thread Shane Nay
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

RE: $r->print and references: Was RE: Slightly OT - Content-length

2000-06-19 Thread John Hughes
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

RE: $r->print and references: Was RE: Slightly OT - Content-length

2000-06-19 Thread Shane Nay
> > 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

RE: $r->print and references: Was RE: Slightly OT - Content-length

2000-06-19 Thread Shane Nay
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

Re: $r->print and references: Was RE: Slightly OT - Content-length

2000-06-19 Thread Perrin Harkins
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