[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] List with only 1 item



> @myMatches =  ($myString =~ /(a.*?t)/);
> a list with only one item ('a is a beaut')? I'd expect more

Then you're expecting too much.  Try //g:

    my $string = 'Julia is a beautiful actress';
    if (my @matches = ($string =~ /(a.*?t)/g)) {
        print "@matches\n";
    }

-Hao

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org