develooper Front page | perl.perl5.porters | Postings from November 2000

Re: IDEA: more for-like map and grep?

Thread Previous | Thread Next
Nicholas Clark
November 23, 2000 15:44
Re: IDEA: more for-like map and grep?
Message ID:
On Thu, Nov 23, 2000 at 12:51:12PM -0800, Abigail wrote:
> On Thu, Nov 23, 2000 at 05:43:46PM +0000, Nicholas Clark wrote:
> > 
> > Not sure. If we did, would we end up with
> > perl -lwe 'sub something {$_[0] =~ s/a/b/; print $_[0]}' \
> >        -e 'something("abc","bcd","cde")'
> > 
> > changing from "Modification of a read-only value attempted" to working?
> > Do we want that change?
> You sound as if you think that DWIM is a bad thing. And you have a real

I don't mean to sound like that.

> hard time convincing me the programmer did not intend to have "bbc"
> printed.

I don't doubt that the programmer intended "bbc"
I'm just not certain that turning all read only constants into things that
automatically spawn a read-write copy of themselves if a write is attempted
is the sort of thing one can innocently do in perl5 and still call it perl5,
confident that it won't break things unexpectedly for someone somewhere.

Do What I Mean (Although It's Not Quite What I Used To Do In This Situation)
doesn't fill me with joy. At least, not today.

Nicholas Clark

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About