Newsgroups: perl.perl6.language
From: fibon...@babylonia.flatirons.org (Luke Palmer)
Date: 05 Jul 2003 12:57:54 -0600
Local: Sat, Jul 5 2003 2:57 pm
Subject: Re: Aliasing an array slice
> On Sat, Jul 05, 2003 at 09:51:29AM -0600, Luke Palmer wrote: I don't think you're supposed to do that: > > Actually, you can't reference a slice! Where the heck does the > Of course not. I presume it points to something non-existent just like > $ perl -le '$a = "pie contest"; $b = \substr $a, 1, 9; $$b = "arro"; print $a' % perl -le '$a = "foobar'; $b = \substr $a,2,3; $a .= "jibby"; $$b = "OBA"; print $a' Because it copies the buffer to resize, and $b points back into the old buffer... But a slice can be used as an lvalue, so I guess it would be valid to The tricky stuff comes in in cases like: my @a = (1,2,3,4,5); Those are just semantics to be nailed down, but it's tricky This really comes down to an issue that I've been biting my For implementation reasons, I'm not sure it's possible to have both Hmm... Luke > Nicholas Clark
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||