App-Diskd
view release on metacpan or search on metacpan
lib/App/Diskd.pm view on Meta::CPAN
#warn "looking up host $host";
return undef unless exists $self->{disks_by_ip}->{$host};
return $self->{disks_by_ip}->{$host};
}
#
# The routines used to pack and unpack a list of disks for
# transmission could take any form, really. The key things to consider
# are that (a) arbitrary spoofed data can't result in us introducing
# security issues (so solutions that involve eval'ing the packed data
# are out, unless we validate that the data is in the expected form)
# and (b) we take into consideration quoting issues (such as not using
# spaces as separators, since they may appear in disk labels). As it
# happens, YAML can solve both of these problems for us. It may not
# make best use of space, but at least it's quick and easy to
# implement.
#
use YAML::XS;
# assume that we don't need to pack any disk list except our own
( run in 0.230 second using v1.01-cache-2.11-cpan-4d50c553e7e )