@ISA = qw(Exporter);
@EXPORT = qw(atime ztime cldate cldatetime slat slong yesno promptf
parray parraypairs shellregex
- print_all_fields cltounix
+ print_all_fields cltounix iscallsign
);
@month = qw(Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec);
return 0 unless $time =~ /^([012]\d)([012345]\d)Z$/;
$time = "$1:$2 +0000";
my $r = str2time("$date $time");
+ return $r unless $r;
return $r == -1 ? undef : $r;
}
{
my $in = shift;
$in =~ s{(.)} { $patmap{$1} || "\Q$1" }ge;
- return '^' . $in . '$';
+ return '^' . $in . "\$";
+}
+
+# start an attempt at determining whether this string might be a callsign
+sub iscallsign
+{
+ my $call = shift;
+ return 1 if $call =~ /^\w+\d+/;
+ return 1 if $call =~ /^\d+\w+/;
+ return undef;
}