develooper Front page | perl.perl5.porters | Postings from March 2016

Re: Antw: Re: [perl #127684] operators '|||' and '&&&'

Thread Previous | Thread Next
From:
Zefram
Date:
March 10, 2016 15:11
Subject:
Re: Antw: Re: [perl #127684] operators '|||' and '&&&'
Message ID:
20160310151100.GK7946@fysh.org
Ulrich Windl wrote:
>It would be useful in the original context. I tired to make this a one-liner:
>    my $index_by_name = sub {
>        my $hi = $header_i{(shift)};
>
>        die unless (defined($hi));
>        return $hi;
>    };

    my $index_by_name = sub { $header_i{(shift)} // die };

This is a defined-or situation, not defined-and.

-zefram

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About