#!/user/bin/perl -w #note: %hash1 contains modified functions, #which has been extracted from a C source file(Test1.c). #this hash is used for referencing purposes @array = %hash1; #### #initiate a loop counter $loop = 0; #using for loop to get rid of new line in the array for (@array){ $array[$loop] =~ s/\n//; $loop++ } #### #opening file for writing open (Done, ">sim.c") or die "Can't open sim.c :$!\n"; #### #initiating a new hash and a string for later use %hash2; $done; #### #a for loop to help popping all the elements in array. for (0..6){ $fish = pop @array; $fish = pop @array; #### #opening of working file, which is to be compared with #the reference array(%hash1) open (Local, "stub.c") or die "Can't open stub.c :$!\n"; for $local(){ $local =~ s/\n//; #this is used to compare the 2 variable #if there is no match, assign it as a key to a hash unless ($fish eq $local){ $hash2{$local}++; } close Local; } } #### #print each key of the hash to verify result foreach $done ( keys %hash2){ print "$done\n"; } #### $;=sub{$/};@;=map{my($a,$b)=($_,$;);$;=sub{$a.$b->()}} split//,".rekcah lreP rehtona tsuJ";$\=$ ;->();print$/