Hi, I wanted to use a switch statement. I ran into difficulties quickly. It looks like I was unlucky. I decided to use if else style instread of the switch.
I wonder why this does not work. What about you? It looks like there is problem with /gc flags on the regular expression.
use Switch;
while ( pos($file) < length($file) ) {
switch ($file)
{
case (/\G\s*object\s+(\w+)\s*\:\s*(\w+)/gc) {
}
}
last if ( $oldpos == pos($file) );
$oldpos = pos($file);
}
It was suggested that something like case (m!\G\s*object\s+(\w+)\s*\:\s*(\w+)!gc) would work. It does not.