Advertisement
Guest User

Untitled

a guest
Sep 25th, 2017
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.72 KB | None | 0 0
  1. #I hate Perl. But at new project I don't have PHP.
  2. #I wrote this turd.
  3. #Instead of the nWHRs and foreach I just want to print the results of this "grep m/^($STR)\-/,@WHRs" with newlines added for each line.# #How to DO ?
  4.  
  5.  
  6. #!/usr/local/bin/perl
  7. # Perl Script to Sort Order
  8.  
  9. $loc_STR = "/DM/commDir/PkgSplit";
  10. $loc_WHR = "/DM/commDir/PkgSplit.WHR";
  11.  
  12. @WHRs    = grep(s{.*/}{}|s{\.[^.]+$}{}, `ls $loc_WHR/*\-1\-1.WHR`);
  13. @STRs    = grep(s{\.[^.]+$}{}, `ls $loc_STR/ | grep ".STR"`);
  14.  
  15. foreach $STR (@STRs) {
  16.  chomp $STR;
  17.  if (grep m/^($STR)\-/,@WHRs) {
  18.    @nWHRs = grep(s{.*/}{}|s{\.[^.]+$}{}, `ls $loc_WHR/$STR*.WHR`);
  19.    foreach $WHR (@nWHRs) {
  20.      print "$WHR WHR\n";
  21.    }
  22.  }
  23.  else {
  24.    print "$STR STR\n";
  25.  }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement