in reply to how to open browser window with given URL on MacOSX?

Doing:

if ($^O eq 'darwin' ) { system( open => $url ) == 0 or die "could not open $url"; };

Should work if the user hasn't misconfigured their box.

Replies are listed 'Best First'.
Re: Re: how to open browser window with given URL on MacOSX?
by Fletch (Bishop) on Apr 22, 2004 at 13:02 UTC

    And just to elaborate, open will also do basically what double-clicking on any item in the Finder would do (open it in the default application, or open a directory in a Finder window). There's also an open source app called launch which can do similar things as well as ask apps to print documents.

    Not that that's got anything to do with perl . . . :)

Re^2: how to open browser window with given URL on MacOSX?
by Popcorn Dave (Abbot) on Aug 15, 2004 at 06:57 UTC
    That may work on a Mac but not on Win32 for some reason. I'm getting the message:

    MSWin32'open' is not recognized as an internal or external command, op +erable program or batch file.

    Using an exec does open the browser, but the program closes after it hits the exec. Any other ideas on how to do this under Win32 without having to use HTML::DIsplay?

    Useless trivia: In the 2004 Las Vegas phone book there are approximately 28 pages of ads for massage, but almost 200 for lawyers.
      That may work on a Mac but not on Win32 for some reason

      The $^O eq 'darwin' should have given that away :-). It's a Max OS X specific binary.