Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: Pesky little URL files to HTML

by Amoe (Friar)
on Dec 23, 2001 at 16:03 UTC ( #134050=note: print w/replies, xml ) Need Help??

in reply to Pesky little URL files to HTML

w00t. This gives me an excuse to post my Perl-IE-favorite-structure-dumper, snappily titled
#!/usr/bin/perl -w use strict; use Data::Dumper; use File::Find; my $favorites_path = shift || 'C:/Windows/Favorites'; # assumptions + are amazing my @favorites; find(\&scan, $favorites_path); print "done reading...\n"; print "outputting to dumped_favorites.txt..."; open OUT, ">dumped_favorites.txt" or die "couldn't dump favorites: $!" +; print OUT Data::Dumper->Dump([\@favorites], ['favorites']); close OUT; print "done.\n"; sub scan { return if ($_ eq '.' || $_ eq '..' || !-f $File::Find::name); my $record = {}; { local $_; open FAVORITE, "<$File::Find::name" or die "couldn't open $Fil +e::Find::name: $!"; while (<FAVORITE>) { s/URL=// and chomp and $record->{url} = $_; } close FAVORITE; } $record->{name} = substr($_, 0, -4); # can rely on as extension + is always url push @favorites, $record; print '.'; }
Fun. I've dumped mine with this many a time.

my one true love

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://134050]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (3)
As of 2018-04-23 23:55 GMT
Find Nodes?
    Voting Booth?