Created
February 19, 2012 23:02
-
-
Save ypresto/1866360 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
#package UrlFile; | |
use Config::Simple; | |
use File::Basename; | |
my $suf_regex = qr/\.url$/i; | |
my $dir = $ARGV[0]; | |
if (!opendir(DIR, $dir)) { | |
print "cannot open dir\n"; | |
exit 1; | |
} | |
foreach (grep{ /\.url$/i && -f "$_" } map{ "$dir/$_" } readdir(DIR)) { | |
my $file = $_; | |
my @filep = fileparse($file, $suf_regex); | |
my $cfg = new Config::Simple($file); | |
my $url = $cfg->param('InternetShortcut.URL'); | |
print "$filep[0] : $url\n"; | |
} | |
closedir(DIR); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment