Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perldoc -f do has unneccessary condition #16593

Open
p5pRT opened this issue Jun 22, 2018 · 3 comments
Open

perldoc -f do has unneccessary condition #16593

p5pRT opened this issue Jun 22, 2018 · 3 comments

Comments

@p5pRT
Copy link

p5pRT commented Jun 22, 2018

Migrated from rt.perl.org#133294 (status was 'open')

Searchable as RT133294$

@p5pRT
Copy link
Author

p5pRT commented Jun 22, 2018

From cpan@zoffix.com

`perldoc -f do` for v5.26.0 as well as current https://perldoc.perl.org/functions/do.html as the very last code example list this code​:

  for $file ("/share/prog/defaults.rc",
  "$ENV{HOME}/.someprogrc")
  {
  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 = ...)`

@p5pRT
Copy link
Author

p5pRT commented Jun 23, 2018

From @jkeenan

On Fri, 22 Jun 2018 18​:25​:59 GMT, cpan@​zoffix.com wrote​:

`perldoc -f do` for v5.26.0 as well as current
https://perldoc.perl.org/functions/do.html as the very last code
example list this code​:

for $file ("/share/prog/defaults.rc",
"$ENV{HOME}/.someprogrc")
{
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 = ...)`

cc-ing the original committer for comment​:

#####
a9a5a0d (Vincent Pit 2009-11-21 22​:07​:31 +0100
#####
--
James E Keenan (jkeenan@​cpan.org)

@p5pRT
Copy link
Author

p5pRT commented Jun 23, 2018

The RT System itself - Status changed from 'new' to 'open'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants