in reply to exist backreference variable list?

welcome to Perl and to the monastry PerlJam2015!

First: dont waste time with a very outdated book! there are some good and recent books about Perl. Some years ago i was in your same situation: first programming language and a very empiric computer experience. The problem you are experiencing is "how to assimilate the syntax" and Perl is a bit hard to approach, like the easter lunch, but as your stomach (mind?) get adapted, you got more and more hungry and you'll see a perlish way to get the job done.

Because of this let me suggest you some different reading. Exists a good book that illustrate in a very effective way the Perl's panorama. I'm talking about 'Perl Cookbook'. May seems a nonsense because that book too is somehow aged. But is perfect Perl 5 even if not so modern. But the cookbook approach separated in meaningful chapter was something invaluable for me.

You preferably get your copy of the free Moder Perl book or read it online. This book is a little harder than cookbook but is full of gems and explication of concepts you dont find in other book (defaults, context, coercion..) and is moder: id est it explains all new features of the language. Take that books together and dont forget the official documentation for function reference, tutorials, core modules docs..

Now something about your question.
Yes, when there are grouping parens in a regular expression Perl automatically put each resulting part in the special variable $<digits> ($1, $2, ...), and yes you can get all results into an array:
perl -e "$ARGV[0] =~ /(a)(l)(l)/; print qq($1 $2 $3) " alltogether #out:a l l perl -e "@array = $ARGV[0] =~ /(a)(l)(l)/; print qq(@array) " alltoge +ther #out:a l l


Regexes can do many many things and is a language inside another. Most of times you'll need only basic features of regexes.

As last tip to learn a good Perl is to pay attention to idioms: prooved and safe ways to do some task in Perl. Perl as one motto that states: 'There is more than one way to do it' (aka TIMTOWTDI or Tim Taody for closer friends..). As you learn more and more the language you tend to write perlish and idiomatic Perl. Some idiom is illustrated here in the tutorials section of the monastery, others in Modern Perl book mentioned above.

HtH
L*
There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.