On Thu, Sep 28, 2000 at 01:02:11PM -0500, Jonathan Scott Duff wrote:
> I thought I had sent this the other day, but it doesn't appear to have
> made it through...
> 
> Here are a couple of ideas that I don't have time to RFC, but some who
> likes them might:
> 
>         1. Allow the first argument to split() to be a number such that
>            the string is broken into chunks of that many characters.
> 
>         2. Allow the first argument to split() to be an array of
>            numbers, such that split returns a list of strings each as
>            long as the corresponding number.
> 
> Yes, I know this can be done with unpack() or substr(), but that's never
> stopped us before.

Ah, but with them you would need a loop.

One other way would be to allow \G to work in split() so you could do

  @ary = split(/\G(<=..)/, $str)

but then we can already do this with

  @ary = $str =~ /\G(..)/sg;

> Note that if #1 is adopted, $foo in "split $foo, $str" will no longer
> really mean "split /$foo/, $str".

Right, and I think that the fact that there are already several ways to
do it, we don't need to add another.

Graham.

Reply via email to