projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
allow 't <call>' for swopping from announces as well
[spider.git]
/
perl
/
DXUtil.pm
diff --git
a/perl/DXUtil.pm
b/perl/DXUtil.pm
index 10b3538767822ef46735fb4cc2a8b267e7a8c024..9d475ed89c8f2f17713b3aabdc9aa6c79d93d4df 100644
(file)
--- a/
perl/DXUtil.pm
+++ b/
perl/DXUtil.pm
@@
-183,6
+183,14
@@
sub parraypairs
return $out;
}
return $out;
}
+sub _sort_fields
+{
+ my $ref = shift;
+ my @a = split /,/, $ref->field_prompt(shift);
+ my @b = split /,/, $ref->field_prompt(shift);
+ return lc $a[1] cmp lc $b[1];
+}
+
# print all the fields for a record according to privilege
#
# The prompt record is of the format '<priv>,<prompt>[,<action>'
# print all the fields for a record according to privilege
#
# The prompt record is of the format '<priv>,<prompt>[,<action>'
@@
-198,7
+206,7
@@
sub print_all_fields
my $width = $self->width - 1;
$width ||= 80;
my $width = $self->width - 1;
$width ||= 80;
- foreach $field (sort {
$ref->field_prompt($a) cmp $ref->field_prompt(
$b)} @fields) {
+ foreach $field (sort {
_sort_fields($ref, $a,
$b)} @fields) {
if (defined $ref->{$field}) {
my ($priv, $ans) = promptf($ref->field_prompt($field), $ref->{$field});
my @tmp;
if (defined $ref->{$field}) {
my ($priv, $ans) = promptf($ref->field_prompt($field), $ref->{$field});
my @tmp;
@@
-343,7
+351,7
@@
sub is_pcflag
# check that a thing is a frequency
sub is_freq
{
# check that a thing is a frequency
sub is_freq
{
- return $_[0] =~ /^
[\d\.]+
$/;
+ return $_[0] =~ /^
\d+(?:\.\d+)?
$/;
}
# check that a thing is just digits
}
# check that a thing is just digits