develooper Front page | perl.perl5.porters | Postings from May 2015

Re: Question/suggestion on perlfunc.pod example

Thread Previous
Glenn Golden
May 13, 2015 02:07
Re: Question/suggestion on perlfunc.pod example
Message ID:
Aristotle Pagaltzis <> [2015-05-13 02:51:38 +0200]:
> * Glenn Golden <> [2015-05-13 00:35]:
> > 	      else
> >             { # Here if final statement of $file evaluates to 'false' }
> >     }
> Uh. That addition is completely bogus.

Oy.  Yes, what I meant was "elsif (not $result)", as you showed.

> But why would anyone write the code that way?

Wasn't implying that it is or is not a way that code "ought to be" written;
it's only purpose is to show explicitly what is mentioned in the text shortly
before the example, i.e. that the value returned from 'do' is that of the
final evaluated statement.

But I defer to your judgement, it's a minor point.  If you feel it's better
without showing that, no problem, let's go with your example as written.
It's certainly an improvment over what was there.

I'll try to appropriately modify the surrounding text (summarizing what
you mentioned about $! and so on) and post a full diff against git perlfunc.pod.
Chances are slim that I'll get it right the first time, but perhaps it's
easier to deal with as a diff, rather than posting raw text.  But, up to you,
just let me know.
In any case, thank you very much for your time and (unintended but useful)
tutorial on all this. 

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