... while () { if (/^.*?

.*?( $sw )/) { # first if ... if ( $dec eq "y" ) { # second if ... } # second if CLOSED and DONE WITH } else { ## this was intended to work with second if statement, but now works with the first if ... } ...