# New Ticket Created by  Matt Diephouse 
# Please include the string:  [perl #33962]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/rt3/Ticket/Display.html?id=33962 >


The readline opcode returns too many lines. Compare the following pir 
with `wc -l`.

  .sub main @MAIN
     .param pmc args
     .local pmc file
     $S0 = args[1]
     file = open $S0, "<"
     $I0 = 0

  LOOP:
     unless file goto END
     $S0 = readline file
     $I0 += 1
     goto LOOP

  END:
     print $I0
     print "\n"
     end
   .end

harmony:~/Projects/parrot ezekiel$ parrot lines.pir README
154
harmony:~/Projects/parrot ezekiel$ wc -l README
      153 README

--
matt diephouse
http://matt.diephouse.com

Reply via email to