How do I launch the default web browser in Perl on any operating system?

前端 未结 3 462
再見小時候
再見小時候 2021-02-07 21:25

I want to open a URL, such as http://www.example.com/, at the end of a Perl script. I don\'t want to access it with WWW::Mechanize but actually show the web page to

3条回答
  •  无人共我
    2021-02-07 22:07

    The second hit on "open url" at search.cpan brings up Browser::Open:

    use Browser::Open qw( open_browser );
    
    my $url = 'http://www.google.com/';
    open_browser($url);
    

    If your OS isn't supported, send a patch or a bug report.

提交回复
热议问题