#!perl -w use strict; my $file = "Link.html"; # File to generate. my $lcolor = "#C0C0C0"; # Color for links. my %links; for( <*.url> ) { my $link = `type "$_"` or die "$^E"; die "System Error! $?\n\$!=$!\n\$^E=$^E\n\t " if 0 != $? >> 8; die "Unusual link, '$link'\n" unless $link =~ s/^ (\[DEFAULT\]\nBASE|\[InternetShortcut\]\n) URL=([^\n]+) # This is the URL for the link. \n.*$/$2/sx; $links{+substr($_,0,-4)} = $link; } my @linkName = reverse sort keys %links; my @linkURL = @links{@linkName}; warn "Replacing $file!\n" and sleep 3 if -e $file; open FILE, "> $file" or die "Unable to open $file!\n\$!=$!\n\$^E=$^E\n\t "; print FILE "\nFavorite Links\n", "\n", "
\n" or die "Print Failed!\n\$!=$!\n\$^E=$^E\n\t "; print FILE "\n\n" or die "Print Failed!\n\$!=$!\n\$^E=$^E\n\t " while @linkURL; print FILE "
", pop( @linkName ), ( @linkURL ? ( "", pop( @linkName ) ) : " " ), "
\n\n\n" or die "Print Failed!\n\$!=$!\n\$^E=$^E\n\t "; close FILE or die "Close Failed!\n\$!=$!\n\$^E=$^E\n\t "; ############################################################################### INIT { die "Intended for use on MSWin32 system.\n" unless 'MSWin32' eq $^O } =head1 Usage Open a command window on your MSWin32 and change directories to Your Favorites\Links\ directory. On my NT box this was: C:\WINNT\Profiles\Adam\Favorites\Links\ Run this script. You will now have a file called Links.html which makes for an excellent start page. =head1 Author Adam www.perlmonks.org =cut