M
machoq
I ask the user to provide me as an argument a perl-pattern
I need to return the user a hash containing the variables which were
set as a sideeffect of the pattern match
So if pattern is /(A+)B(C*)/
it will set 2 variables $1 and $2.... and I can push them in my hash
but what happens if the pattern is dynamic...the user provides the
pattern and i do not know how many $1...$2...$n will it set ?
Is there a way i can identify how many variables are available for me
to consume ? Is there a limit on how many variables will be set as a
sideeffect of a match ?
Thanks
-Machoq
I need to return the user a hash containing the variables which were
set as a sideeffect of the pattern match
So if pattern is /(A+)B(C*)/
it will set 2 variables $1 and $2.... and I can push them in my hash
but what happens if the pattern is dynamic...the user provides the
pattern and i do not know how many $1...$2...$n will it set ?
Is there a way i can identify how many variables are available for me
to consume ? Is there a limit on how many variables will be set as a
sideeffect of a match ?
Thanks
-Machoq