I have been slaving away at a few Perl/TK applications that are about ready to be released to the big wide world. I have developed the code to be as OS independent as possible and am trying to clear up a few last points. On the "About" window of the app's there is a button that opens an url in the users preferred web browser.
The code below illustrates the windows method I'm using:

#!/usr/bin/perl -w <br> use strict; <br> my $url = "http://www.perlmonks.org/"; <br> use Win32::FileOp qw(ShellExecute); <br> my $rc = ShellExecute("open", $url);

The user documentation with graphics is a pdf file which is also opened the same way.

Does anyone know
1. An OS independent way of opening an url or file from a Perl/TK application that won't lock the original application or
2. A method suitable for MacOSX, Linux, Sun OS's?

This is probably trivial to anyone with U*NIX skills and I'm sure someone has done this before. Any help appreciated.


In reply to Opening a url from a Perl/TK app in UNIX by lostcause

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.