4 # initialize all of the variables
25 $spacer = "===========================================\n";
29 # process input by line
34 # save current line of text as $line
38 # if we're in print mode and if the line starts with a blank space
39 # decrement the line counter
40 if( ($line =~ /^\s+/) && $mode > 0)
45 #save the stack to compare against found stacks
46 $strStack = $strStack . $line;
55 # increment for each line that we read, if we're in print mode
56 # or if we're not in print mode and we see a java exception line, then go into print mode.
61 elsif( $line =~ /^java\./)
67 # save the stack if we're in print mode. otherwise, adjust for previous lines
68 if( ($mode > 0) && ($mode < 10))
70 $stackArray[$i] = $line;
89 # check to see if we've copied the entire stack.
93 # check to see if this stack has already been found
97 if ($allStacks[$x] eq $strStack)
99 #stack already been found
107 if ($stackFound == 1)
109 #this stack has already been found, skip the printing
114 #add this stack to the list of known stacks
115 $allStacks[$j] = $strStack;
119 # print out the previous lines
139 print $stackArray[$x];
146 # re-initialize some variables