in reply to collecting array from pattern parenthesis

You're close enough already that I wonder if I'm misunderstanding the question.

use strict; use warnings; use Data::Dumper; my $string_containing_needed_matches = 'XXXreYYY' x 3; my @arr = $string_containing_needed_matches =~ /XXX(re)YYY/g; print Dumper \@arr; __END__ $VAR1 = [ 're', 're', 're' ];

Replies are listed 'Best First'.
Re^2: collecting array from pattern parenthesis
by vit (Friar) on Sep 26, 2008 at 16:52 UTC
    Yes, I am. I do not know why it did not work before. Now it works and thaks a lot.
      It didn't work because you wrote = instead of =~.
        No, it's only here. In my code everything was fine. Maybe some other thing which i did not notice.