Re: Perl 6.x , please offer PREPEND as well as APPEND
- From: xhoster@xxxxxxxxx
- Date: 31 Jan 2006 15:11:55 GMT
"Mr P" <MisterPerl@xxxxxxxxx> wrote:
> Dear Damian, Larry, et al:
>
> The asymetric PREPEND and APPEND should be addressed in 6.x:
>
> # append a string, very nice
> $song .= ' Her Majesty The Queen';
>
> # prepend a string - YUK, ugly, [1]
> $song = ' Her Majesty The Queen ' . $song;
Not only ugly, but also slow if $song is large. You can use the
four argument substr to (potentially) make it faster, but then it is
even uglier.
But I don't see a tremdous need for a new operator here. If you are doing
a lot of prepending, chances are you are doing something wrong, I'd think.
Xho
--
-------------------- http://NewsReader.Com/ --------------------
Usenet Newsgroup Service $9.95/Month 30GB
.
- Follow-Ups:
- Re: Perl 6.x , please offer PREPEND as well as APPEND
- From: Robert Sedlacek
- Re: Perl 6.x , please offer PREPEND as well as APPEND
- References:
- Prev by Date: Re: split the sequences
- Next by Date: Re: split the sequences
- Previous by thread: Re: Perl 6.x , please offer PREPEND as well as APPEND
- Next by thread: Re: Perl 6.x , please offer PREPEND as well as APPEND
- Index(es):
Relevant Pages
|