sub by_priority {
# Return 0 on string identity
return 0 if $a eq $b;
return -1 if $a =~ /^Organization/ ;
return 1 if $b =~ /^Organization/ ;
return -1 if $a =~ /^Service/ ;
return 1 if $b =~ /^Service/ ;
return -1 if $a =~ /^FAQ/ ;
return 1 if $b =~ /^FAQ/ ;
return 0 ;
}
####
my @priorities = qw(Organization FAQ Service);
my $prio_top = join "|", map { "^$_" } @priorities;
sub by_priority {
# Return 0 on string identity
return 0 if $a eq $b;
return -1 if $a =~ /$prio_top/o;
return 1 if $b =~ /$prio_top/o;
# Alphabetical sort for the rest
return $a cmp $b;
}
####
perl -MHTTP::Daemon -MHTTP::Response -MLWP::Simple -e ' ; # The
$d = new HTTP::Daemon and fork and getprint $d->url and exit;#spider
($c = $d->accept())->get_request(); $c->send_response( new #in the
HTTP::Response(200,$_,$_,qq(Just another Perl hacker\n))); ' # web