Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- @list = ();
- $link = '';
- while (<>){
- while (s/<\s*a\s*href\s*=\s*"([^"]*?)"[^>]*>//){
- $link = $1;
- $link =~ s/(?:(?:\w*\:\/\/)|)(?:(?:\/\/)|)([^\/:#?]*)((\/|:|#).*)?/\1/;
- if ($link =~ /^.+$/){
- @list = (@list, $link);
- }
- }
- }
- @list =sort (@list);
- if (@list > 0){
- print $list[0]."\n";
- for (my $i = 1; $i < @list; $i++){
- if (($list[$i-1] ne $list[$i])){
- print $list[$i]."\n";
- }
- }
- }
Add Comment
Please, Sign In to add comment