in reply to Re: iterator w/ wantarray()
in thread iterator w/ wantarray()

What's wrong with:

#should print 1, 4, 7

Greetings,
-jo

$gryYup$d0ylprbpriprrYpkJl2xyl~rzg??P~5lp2hyl0p$

Replies are listed 'Best First'.
Re^3: iterator w/ wantarray()
by stevieb (Canon) on Apr 25, 2020 at 21:38 UTC

    I don't normally look for expected results in a comment at the bottom of the code. It should be expressed along with the problem statement.

    Beyond that, I don't even look at code if the OP doesn't provide a problem statement, expected, and actual results up front. Why look at code to solve a problem for someone, if they don't at least state what's expected from it clearly? I might find 30 issues to fix, but I've wasted my time if I didn't fix the one thing that was broken to them.

      Besides the phrase "in a comment", would your statement hold for an example written as a Test::More script, too?

      Greetings,
      -jo

      $gryYup$d0ylprbpriprrYpkJl2xyl~rzg??P~5lp2hyl0p$

        OP didn't post a question related to a Test::More script.

        Unit testing questions are different, and the way I approach them is determined by whether the poster is the author of the test and the software behind it, or is simply having an issue during an install of software they want to use, but likely doesn't have any idea how the internals or its tests work.

        I have gone on to supply patches to a good number of Open Source projects over the years because someone was having problems with unit tests of software they were simply trying to install and use, and I found bugs which I corrected.