From: Mark Fowler <[EMAIL PROTECTED]>
Date: 1/29/03 10:21:18 AM

> Another way is to use a loop with a regular expression to 
> match two chars with the funky 'g' option to tell it to 
> match each loop starting from where it left off at the end
> of the previous loop (so it moves slowly along the input 
> string).
>
>  my @array;
>  while ($input =~ /(..)/g)  # while we match.
>  {
>    # store the thing in the ( ) in the regex in @array.
>    push @array, $1;
>  }

And that can be simplified to

my @array = $input =~ /(..)/g;

Dave...

-- 
<http://www.dave.org.uk>

"Let me see you make decisions, without your television"
   - Depeche Mode (Stripped)





Reply via email to