in reply to Re: Refactoring challenge.
in thread Refactoring challenge.
The 1+index idiom baffled me, it requires that you know index returns -1 if no match. Thanks to demerphq for helping me understand.#$nesting++ if 1+index '[{', $char; #$nesting-- if 1+index ']}', $char; $nesting++ if $char=~/[[{]/; $nesting-- if $char=~/[\]}]/; # not sure if I escaped this right
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Refactoring challenge.
by BrowserUk (Patriarch) on Mar 08, 2005 at 17:31 UTC |