while () { my $exp_idstr = sprintf( "%o", $expected_id ); if ( s/\(LABEL O $exp_idstr\)\n/$1 NEWSTUFF/ ) { ...