Created
April 30, 2015 15:01
-
-
Save bentglasstube/1b146706c31ce50f3eb3 to your computer and use it in GitHub Desktop.
Search metacpan for keywords from vim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
# in vim, :set keywordprg=perl-doc-lookup | |
use strict; | |
use warnings; | |
my $search = shift; | |
my $url = 'https://metacpan.org/'; | |
if ($search =~ /::/) { | |
$url .= "pod/$search"; | |
} else { | |
$url .= "search?q=$search"; | |
} | |
exec $ENV{BROWSER}, $url; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment