in reply to Re^3: HTML::Display help needed
in thread HTML::Display help needed

I'd be happy to try. I am not a perl guru so I don't really know what it means by 'class' in that context. What I would expect logically, is a variable or some way to determine the path to the desired browser that should be launched. That is what seems missing to me in the documentation. I don't know how to tell it to use IE or Firefox or whatever the default browser is. I assumed (yes this is a classic case of what that makes of 'u' and 'me') it had a way to determine it from the OS settings but apparently not. If that is the case then that complicates things as I believe finding the default browser would be a platform dependent function and better left as a configuration issue when using HTML::Display.

Replies are listed 'Best First'.
Re^5: HTML::Display help needed
by Corion (Patriarch) on Aug 21, 2008 at 13:45 UTC

    Have you seen the PERL_HTML_DISPLAY_COMMAND documentation? It allows you to specify the browser to be launched.

      I saw this:

      If there is no specialized class yet, but your browser can be controlled via the command line, then setting PERL_HTML_DISPLAY_COMMAND to the string to navigate to the URL will make HTML::Display use a system() call to the string. A %s in the value will be replaced with the name of the temporary file containing the HTML to display.

      I don't understand it. Is it trying to say I should launch the browser from command line, then use PERL_HTML_DISPLAY_COMMAND as a scalar to pass the string? What do I pass to '$browser->display'?

        Lets say you have a browser /usr/bin/firefox on your machine and you can start firefox simply with an URL as parameter like this:  /usr/bin/firefox http://www.google.com would start firefox with google displayed.

        Then you can set the environment variable PERL_HTML_DISPLAY_COMMAND to '/usr/bin/firefox %s' and otherwise leave your script unchanged.

        That's it. Run your script. It will automatically call firefox and substitute %s with the name of a temporary file it just generated