in reply to Re: Choose your own Adventure - for Perl & Windows
in thread Choose your own Adventure - for Perl & Windows

... but it's right there:

# Automatically start a webbrowser to http://localhost:$CFG{'MYPORT'} if($0 =~/.exe$/i){ system("start","http://localhost:$CFG{'MYPORT'}"); }

And it starts any default OS browser defined by the user currently logged in (user friendly!)

/joke Yes... a typo... should I fix the text or leave it in?

Replies are listed 'Best First'.
Re^3: Choose your own Adventure - for Perl & Windows
by afoken (Chancellor) on Apr 12, 2017 at 13:39 UTC
    # Automatically start a webbrowser to http://localhost:$CFG{'MYPORT'} if($0 =~/.exe$/i){ system("start","http://localhost:$CFG{'MYPORT'}"); }

    That won't work on Linux, *BSD, other Unixes (and yes, .exe is a legal file extension for a perl script on any Unix).

    The following code fragment correctly identifies Windows, and also starts the web browser if you run the bare perl script:

    if ($^O eq 'MSWin32') { system("start","http://localhost:$CFG{'MYPORT'}"); }

    Yes... a typo... should I fix the text or leave it in?

    You could use <strike></strike>.

    Alexander

    --
    Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)