Re: named params, @_, and pass-by-reference

2002-04-19 Thread Damian Conway
Trey Harris wrote: > > In a message dated Wed, 17 Apr 2002, Dave Storrs writes: > > sub load_data ( \$filename; $version; @_ ) { > > I think you can do exactly this with > sub load_data ( $filename is rw, $version, @_ ) { > > Yes? Or maybe > sub load_data ( $filename is r

Re: named params, @_, and pass-by-reference

2002-04-17 Thread Dave Storrs
[Several people said something like "$var is rw will do it") Ah, that's right. I had forgotten about this. Thanks to everyone who responded. Dave

Re: named params, @_, and pass-by-reference

2002-04-17 Thread Trey Harris
In a message dated Wed, 17 Apr 2002, Dave Storrs writes: > sub load_data ( \$filename; $version; @_ ) { I think you can do exactly this with sub load_data ( $filename is rw, $version, @_ ) { Yes? Or maybe sub load_data ( $filename is rw, $version, *@_) { to make sure @_ g

Re: named params, @_, and pass-by-reference

2002-04-17 Thread Jonathan Scott Duff
On Wed, Apr 17, 2002 at 11:15:15AM -0700, Dave Storrs wrote: > Perhaps using \ in the signature to indicate p-b-r is not the > best...it could confuse people into thinking that they will need to > manually dereference the variable, which they shouldn't need to do. > > Is there a way t

named params, @_, and pass-by-reference

2002-04-17 Thread Dave Storrs
On Thu, 11 Apr 2002, Damian Conway wrote: > Piers wrote: > > > one could always handle the first case > > more explicitly by doing: > > > >sub load_data ($filename; $version) { > > $version = 1 if @_.length < 2; > > ... > >} > > Err...no. If you specify named parameters, you