I
inuy
Hello ,
I have a regular express like this:
(...)(..)\s*(.)(...)....(\d*)....
And I want to store some information from it , I can use $data[1] =
$1;$data[2]=$2; $data[3]=$3 an so on.
But if there are more than ten data I need to store and I don't like
to write them by hand , I hope to store them by for loop or what else.
So I write this "wrong" code:
/(...)(..)\s*(.)(...)....(\d*)..../;
for $i ( 1..10 ){
$data[$i] = ${$i};
}
Obviously , it doesn't work.
Could somebody knows how to deal with this kind of problem?Thank you.
I have a regular express like this:
(...)(..)\s*(.)(...)....(\d*)....
And I want to store some information from it , I can use $data[1] =
$1;$data[2]=$2; $data[3]=$3 an so on.
But if there are more than ten data I need to store and I don't like
to write them by hand , I hope to store them by for loop or what else.
So I write this "wrong" code:
/(...)(..)\s*(.)(...)....(\d*)..../;
for $i ( 1..10 ){
$data[$i] = ${$i};
}
Obviously , it doesn't work.
Could somebody knows how to deal with this kind of problem?Thank you.