On Sun, Jan 07, 2001 at 08:56:32PM +0000, Ton Hospel wrote: > > Fair enough. Try this: > > I am returning a value from a subroutine. > > The value I am returning is the value of the first parameter. > > The value of first parameter of the subroutine is modifiable. > > The value that I am returning is modifiable. > > > > Where's the fallacy? > > You are returning a COPY of the value of the first parameter. Not so! shift does not make a copy: % perl -le '$a= 1; print \$a;foo($a);sub foo { print \do { shift}} ' SCALAR(0x80fa19c) SCALAR(0x80fa19c) Remember that we are passing around *values stored in variables*. -- I used to be disgusted, now I find I'm just amused. -- Elvis CostelloThread Previous | Thread Next