develooper Front page | perl.perl5.porters | Postings from June 2018

[perl #133294] `perldoc -f do` has unneccessary condition

Thread Previous
Zoffix Znet
June 22, 2018 18:26
[perl #133294] `perldoc -f do` has unneccessary condition
Message ID:
# New Ticket Created by  Zoffix Znet 
# Please include the string:  [perl #133294]
# in the subject line of all future correspondence about this issue. 
# <URL: >

`perldoc -f do` for v5.26.0 as well as current as the very last code example list this code:

   for $file ("/share/prog/defaults.rc",
        unless ($return = do $file) {
            warn "couldn't parse $file: $@" if $@;
            warn "couldn't do $file: $!"    unless defined $return;
            warn "couldn't run $file"       unless $return;

The last conditional (`unless $return) is not necessary as that entire block is already guarded by `unless ($return = ...)`

Thread Previous Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About