#!/usr/bin/perl -w # nerxscode # Time-stamp: <2001-07-14 19:06:56 nik@nerxs.com> # grabber.pl # extract urls from data-files $| = 1; # Output autoflush $i = 0; if ($i != 0) { print "\n"; $i++; } if ($ARGV[0]) { $path = $ARGV[0]; open(FH, "+< $path") or die "could not open $path: $!"; while() { foreach ($_) { ($key, $val) = /^(\w+):\s*(.*)$/; $site{$key} = $val; } } chomp($path); print $site{'URL'} . " "; } else { while () { $path = $_; open(FH, "+< $path") or die "could not open $path: $!"; while() { foreach ($_) { ($key, $val) = /^(\w+):\s*(.*)$/; $site{$key} = $val; } } chomp($path); print $site{'URL'} . "\n"; } }