/$comment|$string/g #### while( ! /\G$/gc ) { if( /\G$comment/gc ) { ... } elsif( /\G$string/gc ) { ... } elsif( /\G$neither/gc ) {