octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #62648] build problem with texinfo>6.8


From: Rik
Subject: [Octave-bug-tracker] [bug #62648] build problem with texinfo>6.8
Date: Mon, 14 Nov 2022 13:38:59 -0500 (EST)

Follow-up Comment #22, bug #62648 (project octave):

I have attached a patch which is slightly more attuned to the Perl way of
doing things.  Specifically, it is almost never necessary to directly check
for EOF.  Per the documentation for eof() in Perl (try 'perldoc -f eof')
 

Practical hint: you almost never need to use "eof" in Perl,
because the input operators typically return "undef" when they
run out of data or encounter an error.


This expression



while (not (eof ($HTML)) and ( ($_ = <$HTML>) !~ /^<ul
class="(no-bullet|toc-numbered-mark)">/ ) ) {;}



can be simplified to


while (defined ($_ = <$HTML>) and ! /^<ul
class="(?:no-bullet|toc-numbered-mark)">/) {;}


where I skip eof() but use the short-circuit operator "and".  I also used the
non-capturing regular expression '(?:A|B)' rather than '(A|B)'.  Perl is so
fast it hardly makes a difference, but we aren't using the captured data from
the regular expression so we might as well tell Perl it can discard it.



(file #53955)

    _______________________________________________________

Additional Item Attachment:

File name: bug62648.cset                  Size:1 KB
    <https://file.savannah.gnu.org/file/bug62648.cset?file_id=53955>



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?62648>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]