Using this Perl script below, I am trying to change the homepage for the Internet Explorer browser by calling on a system fucntion. How do I call and modify the system file that contains Internet Explorer's homepage to change the url in it? *I am using the header 'use Win32::OLE.'

I had a few logical errors on my original post. This one is error-free. Thanks!

use Win32::OLE;

print "What url would you like to make as Internet Explorer's home page?\n";
print "(no spaces, the url as you normally see it on the adderess bar)\n";

while (!$url)
    print "You did not make and entry! Please enter a url.\n";

while ($url)
    if ($url =~ /\s/)
        print "That's not a url! You entered a space somewhere. Re-enter:\n";


        print "\nYour home page in IE has been changed! Re-open IE and see!";

You didn't show how you use the module Win32::OLE, so really one might not know how and where you are having issues with your code.

There are several part of the code you need to upgrade. Like, why use 2 while loop?

Yes, the Win32::OLE is the header I'm trying to use to call the system file for Internet Explorer that contains the home page url and modify it, and that's the code I need that's missing.

I preffer to use while loops for input check control. That's why you see two while loops. I can also just use one while loop, I am aware of that. Thanks!

Hi jg1405,

Really, I don't get what you wanted done. However, I remember I use to use a perl script to load any url i wanted from the CLI -- command line interface, when I was on window system.

Check below and see if this helps in any way.

use warnings;
use strict;
use Win32::OLE;
use OLE;

my $default_add = "";
print "No Address specified, so I loaded the default:"
  unless defined $ARGV[0];
my $url = $ARGV[0] ? $ARGV[0] : $default_add;
my $browser = CreateObject OLE "InternetExplorer.Application.1" || return 0;
$browser->{'Visible'} = 1;

If it changes the homepage to Internet Explorer, it works. I have to set the user entry for url as the url for Internet Explorer instead of it being the default like you have it here. I will try it. Thanks!

I have to set the user entry for url as the url for Internet Explorer

That is exactly what the script does. Is only when you don't give the script a URL to use that it uses the default URL.

Usage is like so:
perl perl_script <URL to change to>

If URL to change to is not available then, the script uses it's default URL. Please check and let me know if you have other issues. Anyway, you can modify the script to your taste.

Yes, but this doen't change the hompage entry for Internet Explorer, it only displays a page you indicate. This is only external. What I need is to change the homapage that you set as your browser's default homapage.

This is getting very close though, at this point all I need to find is the one line of code that sets the hompage. Maybe if I find the registry line item that sets the homapage for IE I can see the name of the variable that I have to specify. Thanks!

Hi jg1405,

Sorry, I didn't see this update before replying to your previous posting (maybe you could have edited that instead of posting another one?)

Anyway, in that reply I recommended some modules for updating the registry. Seems you came to that conclusion by yourself as well :)

Good luck (although, obviously, you shouldn't be working on Windows in the first place :)