spx2 has asked for the wisdom of the Perl Monks concerning the following question:
hello again fellow monks
ive encountered a big problem. what i need to do is
if i want all of these it seems i need to have the regex in an eval so that the program doesnt stop if the regex fails.if i want $@ i just use it but if its in an eval there will be no $@. if i want to see if the regex failed or not i can check like if($string=~/$regex/) {#succeded} but that looses my $@ and the matches array($1,$2,...) im pretty sure i need to use eval because i need to get the $@ wich i need to tell the user errors his regex caused. and i have tried sever combinations of the questions 2),3),4) and i have achieved only partial succes. i dont know what to do because i also have this problem with persistance of memory wich it seems i cannot fix easily because the matches variables are readonly(i would clear them out to be sure ive got a thing out of the way but i cant).
what do you suggest doing ?
how should i approach the problem?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: regex persistence of matches
by blokhead (Monsignor) on Jun 18, 2007 at 18:43 UTC | |
|
Re: regex persistence of matches
by thezip (Vicar) on Jun 18, 2007 at 18:33 UTC | |
|
Re: regex persistence of matches
by andreas1234567 (Vicar) on Jun 18, 2007 at 18:20 UTC | |
|
Re: regex persistence of matches
by Anonymous Monk on Jun 18, 2007 at 18:32 UTC |