diff_hkl()

$ret = diff_hkl( h => 1, k => 0, l => 0, psi => 90);
$ret = diff_hkl( h => 1, k => 0, l => 0);
$ret = diff_hkl( h => 1, k => 0, l => 0, psi_from_ub => 1);

This function can be used to set one or more components of the hkl-vector. If neither psi nor psi_from_ub is supplied, the current psi value is kept.

If diff_hkl() is called without arguments, it returns the current hkl-vector. It depends on the context whether it returns a list or a string:

List context: my ( $h, $k, $l, $psi) = diff_hkl();

Scalar context: $buffer = diff_hkl();
$buffer contains: (h, k, l, psi).