Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- my $file=@ARGV[@ARGV-1];
- my %cm,$found=0;
- while (<STDIN>)
- {
- if (m/\|---(.*)\((.*)\)/)
- {
- ($tmp,$tmp2)=($1,$2);
- $tmp=~s/\s*$//;
- $cm{$tmp}="(${tmp2})";
- next;
- }
- if (m/---/)
- {
- $found=1;
- chomp;
- if (m/---(.*?)(?<!http:)\/\/(.*)/)
- {
- ($tmp,$tmp2)=($1,$2);
- $tmp=~s/\s*$//;
- $tmp2=~s/(?<!^)\d.*\s+to\s+//i;
- $tmp2=~s/\s+/ /;
- $cm{$tmp}="//".$tmp2;
- }
- }
- else
- {
- last if $found;
- }
- }
- open FAILO,$file;
- while (<FAILO>)
- {
- if (m/---(.*)/)
- {
- chomp($1);
- $tmp=$1;
- $tmp=~s/\s*$//;
- if (exists $cm{$tmp})
- {
- chomp;
- print $_." ".$cm{$tmp}."\n";
- next;
- }
- }
- print;
- }
- close FAILO;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement