Jim Meyering wrote:
However, I find it more readable to group the two $device-setting
statements together:
my $device = $self->config("host_block_devices/[$devindex]/path",
undef);
$device ||= $self->config("host_block_devices/[$devindex]", undef);
Taking Dan's correction into account, you might want to write it like this:
my $device = ($self->config("host_block_devices/[$devindex]/path",
undef)
|| $self->config("host_block_devices/[$devindex]", undef)
|| return undef);
or perhaps, more technically correct, in case the config value is "0":
my $device = ($self->config("host_block_devices/[$devindex]/path",
undef)
|| $self->config("host_block_devices/[$devindex]",
undef));
defined $device
or return undef;