in reply to How to cater a self defined escape char in regex ?
Are you sure that your question is not an XY Problem?
Why do you construct your string in the first place while you can avoid parsing it back using regexes if you make a simple check, like this?
(read Conditional Operator if you don't know what <condition> ? <value> : <value> means)my $greet = $name ? $obj->{getName}->($name) : "<what you wanted to do + in case of (unknown)>";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to cater a self defined escape char in regex ?
by exilepanda (Friar) on Apr 08, 2013 at 17:36 UTC |