split by ",", shift the resulting array, here you are.
my @results = split /,/,$_; shift @results; print "@results\n";
| [reply] [d/l] |
use warnings;
use strict;
my $f='chapter 01,02,03,04';
if(my @m=$f=~/,([0-9]{2})/g){
print "@m\n"; #prints 02 03 04
}
Note: I would rather use a scalar variable, instead of an array variable with only one element like you had.
If you tell me, I'll forget.
If you show me, I'll remember.
if you involve me, I'll understand.
--- Author unknown to me
| [reply] [d/l] |
if your using use @m array.. if possible to store in any variable.
| [reply] |
if your using use @m array.. if possible to store in any variable. No, all variables must be named @m
| [reply] |