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

Self contained single thread Perl webbrowser

Are you sure? I don't see anything looking like a browser, but much code that looks like a primitive web server.

Alexander

--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
  • Comment on Re: Choose your own Adventure - for Perl & Windows

Replies are listed 'Best First'.
Re^2: Choose your own Adventure - for Perl & Windows
by FreeBeerReekingMonk (Deacon) on Apr 11, 2017 at 22:19 UTC
    ... 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?

      # 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". ;-)