open (AddFile, "AddFile.pl"); @AddFileList = ; close AddFile; @AddFileList = (MakeVariableList(\@AddFileList)); open (CatSrc, "CatSrc.pl"); @CatSrcList = ; close CatSrc; @CatSrcList = (MakeVariableList(\@CatSrcList)); open (Defect, "Defect.pl"); @DefectList = ; close Defect; @DefectList = (MakeVariableList(\@DefectList)); open (DelFile, "DelFile.pl"); @DelFileList = ; close DelFile; @DelFileList = (MakeVariableList(\@DelFileList)); open (Enlist, "Enlist.pl"); @EnlistList = ; close Enlist; @EnlistList = (MakeVariableList(\@EnlistList)); open (In, "In.pl"); @InList = ; close In; @InList = (MakeVariableList(\@InList)); open (Log, "Log.pl"); @LogList = ; close Log; @LogList = (MakeVariableList(\@LogList)); open (Out, "Out.pl"); @OutList = ; close Out; @OutList = (MakeVariableList(\@OutList)); open (ReDub, "ReDub.pl"); @ReDubList = ; close ReDub; @ReDubList = (MakeVariableList(\@ReDubList)); open (Scomp, "Scomp.pl"); @ScompList = ; close Scomp; @ScompList = (MakeVariableList(\@ScompList)); open (Ssync, "Ssync.pl"); @SsyncList = ; close Ssync; @SsyncList = (MakeVariableList(\@SsyncList)); open (Status, "Status.pl"); @StatusList = ; close Status; @StatusList = (MakeVariableList(\@StatusList)); open (WinDiff, "WinDiff.pl"); @WinDiffList = ; close WinDiff; @WinDiffList = (MakeVariableList(\@WinDiffList)); open (SlmSubs, "SlmSubs.pm"); @SlmSubsList = ; close SlmSubs; @SlmSubsList = (MakeVariableList(\@SlmSubsList)); @AllScriptVariableList = (); push @AllScriptVariableList, @AddFileList; push @AllScriptVariableList, @CatSrcList; push @AllScriptVariableList, @DefectList; push @AllScriptVariableList, @DelFileList; push @AllScriptVariableList, @EnlistList; push @AllScriptVariableList, @InList; push @AllScriptVariableList, @LogList; push @AllScriptVariableList, @OutList; push @AllScriptVariableList, @ReDubList; push @AllScriptVariableList, @ScompList; push @AllScriptVariableList, @SsyncList; push @AllScriptVariableList, @StatusList; push @AllScriptVariableList, @WinDiffList; @GlobalVariableHash = (); @GlobalVariableList = (); foreach $ScriptVariableListEntry (@AllScriptVariableList) { if (!$GlobalVariableHash{ $ScriptVariableListEntry}) { push @GlobalVariableList, $ScriptVariableListEntry; $GlobalVariableHash{ $ScriptVariableListEntry}++; } } foreach $SlmSubsEntry (@SlmSubsList) { if ($SlmSubsEntry =~ /([\%\$\@])main::(.*)/) { if (!$GlobalVariableHash{ "$1$2"}) { print "$1$2\n"; } } } sub MakeVariableList # __________________________________________________________________________________ # # Takes a list of text lines and pulls the variables out of them and stores them # in a list # # Parameters: # List reference # # Output: # None # __________________________________________________________________________________ { # # Set @List to First Parameter # @ScriptList = @{$_[0]}; @ScriptVariableList = (); %ScriptVariableHash = (); foreach $ScriptLine (@ScriptList) { # # Split up $ScriptLine into a list of entries. # @ScriptLineVariableList = ($ScriptLine =~ /([\$\@\%][a-zA-Z]+[\w|\:]+)/g); foreach $ScriptLineVariable (@ScriptLineVariableList) { if (!$ScriptVariableHash{ $ScriptLineVariable}) { push @ScriptVariableList, $ScriptLineVariable; $ScriptVariableHash{ $ScriptLineVariable}++; } } } return (sort @ScriptVariableList); }