How to open browser for url using ActivePerl on Windows?

In ActivePerl on Windows, how do I open a browser at some URL?

It exists in Python webbrowser.open(url), but I cannot find the Perl equivalent.

+3
source share
3 answers

Not sure if there is a “right” way to do this, but this should work:

my @command = ('start', $url);
system(@command);

"start" is a Windows command that will use any program associated with it to open an argument. As long as $ url looks like a URL (make sure it starts with http (s): //), it should start the browser.

+7
source

, ActivePerl Windows, , system(), , . OS X 'start' 'open', . .

+1

in windows: start on modern unixen (that is, with xdg-utils installed): open xdg

-1
source

Source: https://habr.com/ru/post/1702720/


All Articles