herby1620 has asked for the wisdom of the Perl Monks concerning the following question:

I'm a bit new, but on review of some PERL code, I see that it is using Win32::OLE to link to InternetExploder to open a URL. This works, but...I want to use a different browser. I've got Mozilla FireFox and it is set as the "default" browser. What incantations do I use to link it up to open the URL I desire. The existing code is:
my $app = new Win32::OLE 'InternetExplorer.Application';
Along with some other stuff. Silly me I thought I could change 'InternetExplorer.Application' to 'FireFox.Application', but that doesn't work. So, I did a search, and here I am. Thanks.

Replies are listed 'Best First'.
Re: Pick the default browser
by Errto (Vicar) on Jan 12, 2006 at 04:45 UTC

    Use Win32::API to call the built-in ShellExecute function for this purpose. See Re: How to start default browser on Windows?.

    Update: I should make clear that the only thing you can do with the browser this way is tell it to browse to a particular address. You can't gain a direct handle on the browser window and make it do things like you can with IE.

Re: Pick the default browser
by ikegami (Patriarch) on Jan 12, 2006 at 04:21 UTC
    As far as I can tell using the OLE browser that comes with ActivePerl, FireFox is not an OLE / ActiveX control, and therefore cannot be controlled via Win32::OLE.