in reply to Retrieving a single value from a Tie::IxHash object

FWIW, the documentation DOES say:
If a single argument is given, returns the single value corresponding to the index. This is usable in either scalar or list context.

                All power corrupts, but we need electricity.

  • Comment on Re: Retrieving a single value from a Tie::IxHash object

Replies are listed 'Best First'.
Re^2: Retrieving a single value from a Tie::IxHash object
by nysus (Parson) on Oct 09, 2017 at 20:56 UTC
    Shoulda RTFM more closely. $hash->FETCH is the method I needed.

    $PM = "Perl Monk's";
    $MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate";
    $nysus = $PM . ' ' . $MCF;
    Click here if you love Perl Monks

Re^2: Retrieving a single value from a Tie::IxHash object
by nysus (Parson) on Oct 09, 2017 at 20:51 UTC
    I should have tested this more thoroughly. No matter what I put in the for the argument to Values, it always returns the first element.

    $PM = "Perl Monk's";
    $MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate";
    $nysus = $PM . ' ' . $MCF;
    Click here if you love Perl Monks