Advertisement
Guest User

Untitled

a guest
May 24th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. my $file=@ARGV[@ARGV-1];
  2. my %cm,$found=0;
  3. while (<STDIN>)
  4. {
  5. if (m/\|---(.*)\((.*)\)/)
  6. {
  7. ($tmp,$tmp2)=($1,$2);
  8. $tmp=~s/\s*$//;
  9. $cm{$tmp}="(${tmp2})";
  10. next;
  11. }
  12. if (m/---/)
  13. {
  14. $found=1;
  15. chomp;
  16. if (m/---(.*?)(?<!http:)\/\/(.*)/)
  17. {
  18. ($tmp,$tmp2)=($1,$2);
  19. $tmp=~s/\s*$//;
  20. $tmp2=~s/(?<!^)\d.*\s+to\s+//i;
  21. $tmp2=~s/\s+/ /;
  22. $cm{$tmp}="//".$tmp2;
  23.  
  24. }
  25. }
  26. else
  27. {
  28. last if $found;
  29. }
  30. }
  31.  
  32. open FAILO,$file;
  33. while (<FAILO>)
  34. {
  35. if (m/---(.*)/)
  36. {
  37. chomp($1);
  38. $tmp=$1;
  39. $tmp=~s/\s*$//;
  40.  
  41. if (exists $cm{$tmp})
  42. {
  43. chomp;
  44. print $_." ".$cm{$tmp}."\n";
  45. next;
  46. }
  47. }
  48. print;
  49. }
  50. close FAILO;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement