All pastes #830882 Raw Edit

Something

public text v1 · immutable
#830882 ·published 2007-12-24 10:23 UTC
rendered paste body
#!/usr/bin/perl
#dEmOn


print "\n ---===Parser===---\n";

print "\nEnter the file containing the url's: ";
$source = <>;

open(FILE, $source) or die("wtf??Can't open it!\n");
my @lines = <FILE>;
close(FILE);

foreach $url (@lines)
{
$url =~ s/^\s+//;
$url =~ s/\s+$//;

unless($url =~ m/^((http[s]?|ftp):\/)?\/?([^:\/\s]+)((\/\w+)*\/)([\w\-\.]+[^#?\s]+)(.*)?(#[\w\-]+)?$/g){next;}

print "protocol: $2\n";
print "host: $3\n";
print "path: $4\n";
print "file $6\n";
print "query $7\n";

print "\n\n---<<END>>---";
$lol = <>;
}
#http://so-bored.net