in reply to Re^3: die in regexp
in thread die in regexp
But I wish to add some protection here. Minimum:$tmpl =~ s/@~(.*?)~@/$hash{$1}/g;
Maximum - also detect orphaned @~ and ~@ like in this example: "some ~@ text @~ here @~".$tmpl =~ s/@~(.*?)~@/ defined $hash{$1} ? $hash{$1} : croak("@~$1~@ not defined") /ge;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: die in regexp
by graff (Chancellor) on Jul 03, 2006 at 21:51 UTC |