#!/usr/bin/perl my $rfzfile="rfzliste.txt"; # Check for existing rfzfile.txt if ( -e $rfzfile ) { #print "rfz exist\n"; my ($dev,$ino,$mode,$nlink,$uid,$gid,$rdev,$size, $atime,$mtime,$ctime,$blksize,$blocks) = stat($rfzfile); if ( ( $mtime => time-3600 ) and ( $ARGV[0] ne "-update" ) ) { #print "keep it\n"; $ARGV[0]="-keep"; } #print "$mtime < ".(time-3600)."\n"; } # download rfzlist.txt if important if ($ARGV[0] ne "-keep") { system("wget http://www.bmvit.gv.at/telekommunikation/funk/funkdienste/downloads/rfzliste.pdf") and die "cant download rfzlist"; system("ps2txt rfzliste.pdf > rfzliste.txt") and die "cant convert rfzlist to text"; unlink("rfzliste.pdf"); } # parse suffixes my %suffix; open(RFZLIST, "< rfzliste.txt") or die "cant open rfzliste"; while() { my @line=split(/\ /); @line=grep(/^OE/,@line); foreach my $rfz (@line){ $rfz=~s/^OE\d//g; $suffux{$rfz}=1; #print "Read suffix $rfz\n"; } } print "Free Suffixes for OE1 OE3 and OE4:\n\n"; my $num=10; foreach my $I (split(/\ /, "A B C D E F G H I J K L M N O P R S T U V W Y")) { foreach my $II (split(/\ /, "A B C D E F G H I J K L M N O P Q R S T U V W X Y Z")) { foreach my $III ("A", "B", "C", "S", "U", "W") { my $rfz=$I.$II.$III; if ( $rfz eq "SOS" ) { next; } # OE1SOS is dangerous if ( ! $suffux{$rfz} ) { print $I.$II.$III." "; if ( $num == 0 ) { $num=10; print "\n"; } else { $num--; } } } } } print "\n\n";