App-wmiirc
view release on metacpan or search on metacpan
lib/App/wmiirc/Dwim.pm view on Meta::CPAN
system config("commands", "file_manager") . " '$file'&";
} else {
system config("commands", "editor") . " '$file'&";
}
} elsif($action =~ m{^\w+://}) {
system config("commands", "browser") . " '$action'&";
} elsif($action =~ m{^[\w.+-]+@}) {
$action =~ s/\@$//; # so I can type foo@ but it gets parsed properly
system config("commands", "mail") . " '$action'&";
} else {
my($host, $rest) = split m{/}, $action, 2;
if(exists $aliases{$host}) {
system config("commands", "browser") . " '" .
sprintf($aliases{$host}, uri_escape_utf8 "$rest@args") . "'&";
# TODO: Use IO::Async's lookup code for non-blocking here
} elsif($host =~ /^\S+:\d+/ || $host !~ / / && gethostbyname $host) {
system config("commands", "browser") . " 'http://$action'&";
} else {
system config("commands", "browser") . " 'https://www.google.com/search?q="
. uri_escape_utf8(join " ", $action, @args) . "'&";
( run in 1.191 second using v1.01-cache-2.11-cpan-d7a12ab2c7f )