Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #I hate Perl. But at new project I don't have PHP.
- #I wrote this turd.
- #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 ?
- #!/usr/local/bin/perl
- # Perl Script to Sort Order
- $loc_STR = "/DM/commDir/PkgSplit";
- $loc_WHR = "/DM/commDir/PkgSplit.WHR";
- @WHRs = grep(s{.*/}{}|s{\.[^.]+$}{}, `ls $loc_WHR/*\-1\-1.WHR`);
- @STRs = grep(s{\.[^.]+$}{}, `ls $loc_STR/ | grep ".STR"`);
- foreach $STR (@STRs) {
- chomp $STR;
- if (grep m/^($STR)\-/,@WHRs) {
- @nWHRs = grep(s{.*/}{}|s{\.[^.]+$}{}, `ls $loc_WHR/$STR*.WHR`);
- foreach $WHR (@nWHRs) {
- print "$WHR WHR\n";
- }
- }
- else {
- print "$STR STR\n";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement