sub asc_encode
{
my $self = shift;
- my $dd = new Data::Dumper([$self]);
- $dd->Indent(0);
- $dd->Terse(1);
- $dd->Quotekeys($] < 5.005 ? 1 : 0);
- return $dd->Dumpxs;
+ return dd($self);
}
#
{
my $s = shift;
my $ref;
+ $s =~ s/\%([0-9A-F][0-9A-F])/chr(hex($1))/eg;
eval '$ref = ' . $s;
if ($@) {
LogDbg('err', $@);
filecopy ptimelist
print_all_fields cltounix unpad is_callsign is_latlong
is_qra is_freq is_digits is_pctext is_pcflag insertitem deleteitem
- is_prefix
+ is_prefix dd
);
return $n ? $main::yes : $main::no;
}
+# provide a data dumpered version of the object passed
+sub dd
+{
+ my $value = shift;
+ my $dd = new Data::Dumper([$value]);
+ $dd->Indent(0);
+ $dd->Terse(1);
+ $dd->Quotekeys($] < 5.005 ? 1 : 0);
+ $value = $dd->Dumpxs;
+ $value =~ s/([\r\n\t])/sprintf("%%%02X", ord($1))/eg;
+ $value =~ s/^\s*\[//;
+ $value =~ s/\]\s*$//;
+
+ return $value;
+}
+
# format a prompt with its current value and return it with its privilege
sub promptf
{
my $q = qq{\$value = $action(\$value)};
eval $q;
} elsif (ref $value) {
- my $dd = new Data::Dumper([$value]);
- $dd->Indent(0);
- $dd->Terse(1);
- $dd->Quotekeys(0);
- $value = $dd->Dumpxs;
- $value =~ s/([\r\n\t])/sprintf("%%%02X", ord($1))/eg;
+ $value = dd($value);
}
$prompt = sprintf "%15s: %s", $prompt, $value;
return ($priv, $prompt);
$via ||= $self->{'-via'} || $self->{to};
unless ($via) {
- dbg("XML: no route specified (" . $self->toxml . ")") if isdbg('chanerr');
+ dbg("XML: no route specified (" . dd($self) . ")") if isdbg('chanerr');
return;
}
if (ref $fromdxchan && $via && $fromdxchan->call eq $via) {
- dbg("XML: Trying to route back to source (" . $self->toxml . ")") if isdbg('chanerr');
+ dbg("XML: Trying to route back to source (" . dd($self) . ")") if isdbg('chanerr');
return;
}
}
if ($fromdxchan->call eq $via) {
- dbg("XML: Trying to route back to source (" . $self->toxml . ")") if isdbg('chanerr');
+ dbg("XML: Trying to route back to source (" . dd($self) . ")") if isdbg('chanerr');
return;
}
if ($dxchan == $main::me) {
- dbg("XML: Trying to route to me (" . $self->toxml . ")") if isdbg('chanerr');
+ dbg("XML: Trying to route to me (" . dd($self) . ")") if isdbg('chanerr');
return;
}