in reply to Re^2: Choose your own Adventure - for Perl & Windows
in thread Choose your own Adventure - for Perl & Windows
# 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
|
|---|