@reducedProtein = initializeStructure ##some operations(\@residueArray,\@secondaryStructureArray); if ($ERRORCHECK ==1) #if global errorcheck is 1 {$response = confirmExit(@ERRORTYPE);} #call error function if($response==1){ simulate(@reducedProtein);} #if not, go to calculations etc #### sub confirmExit { *create a window* my @ERRORTYPE=@_; *write something on the window according to errortype values* *create button exit, which exits the program when pressed* *create button ignore, which sets the value of $response to 0 if pressed* return $reponse;