On Fri, Sep 29, 2017 at 12:05 AM, ToddAndMargo <toddandma...@zoho.com>
wrote:

> sub all-dimensions(% (:length(:$x), :width(:$y), :depth(:$z))) {
>     $x andthen $y andthen $z andthen True
> }
>
> it turn my hash into single variables.  Is there a way to
> test if the right keys are present and keep my hash afterwards?
>

That's just one example. I would expect something like this to work:

    sub foo(%bar (:length($)!, :width($)!)) {

which gives you the named one (instead of using the anonymous hash to
suppress it) and should test for requred keys while discarding their
(separated) values. Or you can use named variables instead f the $
placeholders if you actually want them.

Note, I am not sure what actually happens with the :$x etc. in the
original; it might be necessary to destructure those as ($ => $) or
something.

-- 
brandon s allbery kf8nh                               sine nomine associates
allber...@gmail.com                                  ballb...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net

Reply via email to