On Sun, Apr 11, 2010 at 10:40 AM, Harry Putnam <rea...@newsguy.com> wrote:

> Why is it that the first two splits do not produce any elements?
>
> #!/usr/local/bin/perl
>
> use strict;
> use warnings;
>
> my $var = 100421;
> my @elems1 = split(/\d/,$var);
> my @elems2 = split(/./,$var);
> my @elems3 = split(//,$var);
>

The first two patterns match every character. When everything is a
separator, there's nothing left as data.

-- 
Robert Wohlfarth

Reply via email to